Skip to content

Commit b6f5506

Browse files
committed
C library: ASM functions take void* pointers
This is the type of the function symbol created by `remove_asmt::gcc_asm_function_call`.
1 parent 19fc213 commit b6f5506

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ansi-c/library/x86_assembler.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33

44
extern int __CPROVER_rounding_mode;
55

6-
void __asm_fnstcw(unsigned short *dest)
6+
void __asm_fnstcw(void *dest)
77
{
88
// the rounding mode is bits 10 and 11 in the control word
9-
*dest=__CPROVER_rounding_mode<<10;
9+
*(unsigned short *)dest = __CPROVER_rounding_mode << 10;
1010
}
1111

1212
/* FUNCTION: __asm_fstcw */
1313

1414
extern int __CPROVER_rounding_mode;
1515

16-
void __asm_fstcw(unsigned short *dest)
16+
void __asm_fstcw(void *dest)
1717
{
1818
// the rounding mode is bits 10 and 11 in the control word
19-
*dest=__CPROVER_rounding_mode<<10;
19+
*(unsigned short *)dest = __CPROVER_rounding_mode << 10;
2020
}
2121

2222
/* FUNCTION: __asm_fldcw */
2323

2424
extern int __CPROVER_rounding_mode;
2525

26-
void __asm_fldcw(const unsigned short *src)
26+
void __asm_fldcw(void *src)
2727
{
2828
// the rounding mode is bits 10 and 11 in the control word
29-
__CPROVER_rounding_mode=((*src)>>10)&3;
29+
__CPROVER_rounding_mode = ((*(const unsigned short *)src) >> 10) & 3;
3030
}
3131

3232
/* FUNCTION: __asm_mfence */

0 commit comments

Comments
 (0)