From f3d05b09b9d4c3bcf47fd352830e02b814bfcdbc Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 1 Dec 2013 18:18:12 +0200 Subject: [PATCH] fix edx arg-reg corruption in fromasm --- tools/mkbridge.c | 5 +++++ tools/protoparse.h | 1 + 2 files changed, 6 insertions(+) diff --git a/tools/mkbridge.c b/tools/mkbridge.c index ac25d38..f0727d4 100644 --- a/tools/mkbridge.c +++ b/tools/mkbridge.c @@ -124,6 +124,11 @@ static void out_fromasm_x86(FILE *f, char *sym, struct parsed_proto *pp) stack_args--; } else { + if (IS(pp->arg[i].reg, "edx")) + // must reload original edx + fprintf(f, "\tmovl %d(%%esp), %%edx\n", + (sarg_ofs - 2) * 4); + fprintf(f, "\tpushl %%%s\n", pp->arg[i].reg); } sarg_ofs++; diff --git a/tools/protoparse.h b/tools/protoparse.h index 7d2d711..c102c49 100644 --- a/tools/protoparse.h +++ b/tools/protoparse.h @@ -64,6 +64,7 @@ static const char *known_types[] = { "void *", "char *", "FILE *", + "int *", "unsigned __int8", "unsigned __int16", "unsigned int", -- 2.39.2