static const char *dword_types[] = {
"int", "_DWORD", "UINT_PTR", "DWORD",
"WPARAM", "LPARAM", "UINT", "__int32",
- "LONG", "HIMC",
+ "LONG", "HIMC", "BOOL",
};
static const char *word_types[] = {
"uint16_t", "int16_t", "_WORD", "WORD",
static void check_func_pp(struct parsed_op *po,
const struct parsed_proto *pp, const char *pfx)
{
+ enum opr_lenmod tmp_lmod;
char buf[256];
+ int ret, i;
if (pp->argc_reg != 0) {
if (/*!g_allow_regfunc &&*/ !pp->is_fastcall) {
ferr(po, "%s: %d reg arg(s) with %d stack arg(s)\n",
pfx, pp->argc_reg, pp->argc_stack);
}
+
+ // fptrs must use 32bit args, callsite might have no information and
+ // lack a cast to smaller types, which results in incorrectly masked
+ // args passed (callee may assume masked args, it does on ARM)
+ if (!pp->is_oslib) {
+ for (i = 0; i < pp->argc; i++) {
+ ret = guess_lmod_from_c_type(&tmp_lmod, &pp->arg[i].type);
+ if (ret && tmp_lmod != OPLM_DWORD)
+ ferr(po, "reference to %s with arg%d '%s'\n", pp->name,
+ i + 1, pp->arg[i].type.name);
+ }
+ }
}
static const char *check_label_read_ref(struct parsed_op *po,