mirror of
https://github.com/frida/tinycc
synced 2024-11-24 08:39:37 +03:00
Fix various errors uncovered by static analysis
Reported-by: Carlos Montiers <cmontiers@gmail.com>
This commit is contained in:
parent
ba286136bf
commit
fdb3b10d06
@ -1901,8 +1901,6 @@ void gfunc_call(int nb_args)
|
||||
for (i = 0; i < nb_args; i++) {
|
||||
if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
|
||||
ALWAYS_ASSERT(FALSE);
|
||||
} else if ((vtop->type.t & VT_BTYPE) == VT_STRUCT) {
|
||||
ALWAYS_ASSERT(FALSE);
|
||||
} else {
|
||||
/* simple type (currently always same size) */
|
||||
/* XXX: implicit cast ? */
|
||||
|
1
tccgen.c
1
tccgen.c
@ -162,7 +162,6 @@ ST_FUNC Sym *sym_push2(Sym **ps, int v, int t, long c)
|
||||
tcc_error("incompatible types for redefinition of '%s'",
|
||||
get_tok_str(v, NULL));
|
||||
}
|
||||
s = *ps;
|
||||
s = sym_malloc();
|
||||
s->asm_label = NULL;
|
||||
s->v = v;
|
||||
|
2
tccpp.c
2
tccpp.c
@ -276,7 +276,7 @@ ST_FUNC char *get_tok_str(int v, CValue *cv)
|
||||
#ifdef _WIN32
|
||||
sprintf(p, "%u", (unsigned)cv->ull);
|
||||
#else
|
||||
sprintf(p, "%Lu", cv->ull);
|
||||
sprintf(p, "%llu", cv->ull);
|
||||
#endif
|
||||
break;
|
||||
case TOK_LCHAR:
|
||||
|
@ -501,7 +501,7 @@ void load(int r, SValue *sv)
|
||||
o(0xc0 + REG_VALUE(v) + REG_VALUE(r)*8);
|
||||
}
|
||||
} else if (r == TREG_ST0) {
|
||||
assert((v >= TREG_XMM0) || (v <= TREG_XMM7));
|
||||
assert((v >= TREG_XMM0) && (v <= TREG_XMM7));
|
||||
/* gen_cvt_ftof(VT_LDOUBLE); */
|
||||
/* movsd %xmmN,-0x10(%rsp) */
|
||||
o(0x110ff2);
|
||||
|
Loading…
Reference in New Issue
Block a user