diff options
-rw-r--r-- | linearize.c | 8 | ||||
-rw-r--r-- | linearize.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/linearize.c b/linearize.c index 33d641b4..4140b60c 100644 --- a/linearize.c +++ b/linearize.c @@ -2174,7 +2174,7 @@ static void add_asm_output(struct entrypoint *ep, struct instruction *insn, stru static pseudo_t linearize_asm_statement(struct entrypoint *ep, struct statement *stmt) { struct instruction *insn; - struct expression *expr; + struct expression *expr, *clob; struct asm_rules *rules; struct asm_operand *op; @@ -2206,6 +2206,12 @@ static pseudo_t linearize_asm_statement(struct entrypoint *ep, struct statement add_asm_output(ep, insn, op); } END_FOR_EACH_PTR(op); + /* and finally, look if it clobbers memory */ + FOR_EACH_PTR(stmt->asm_clobbers, clob) { + if (!strcmp(clob->string->data, "memory")) + insn->clobber_memory = 1; + } END_FOR_EACH_PTR(clob); + return VOID; } diff --git a/linearize.h b/linearize.h index a77e4b3e..fb513276 100644 --- a/linearize.h +++ b/linearize.h @@ -150,6 +150,7 @@ struct instruction { struct /* asm */ { const char *string; struct asm_rules *asm_rules; + int clobber_memory:1; }; }; }; |