From 5eaa9bcddfc15890bbe7e33f9be77047b42315b6 Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Mon, 16 Dec 2024 02:46:36 -0800 Subject: [PATCH] rewriter: add comment explaining that `emit_epilogue` undoes param reg `pushq`s from `emit_prologue` --- tools/rewriter/GenCallAsm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/rewriter/GenCallAsm.cpp b/tools/rewriter/GenCallAsm.cpp index 5f898be0c..3e59fdc91 100644 --- a/tools/rewriter/GenCallAsm.cpp +++ b/tools/rewriter/GenCallAsm.cpp @@ -1037,6 +1037,8 @@ std::string emit_asm_wrapper(AbiSignature &sig, add_asm_line(aw, ".type "s + wrapper_name + ", @function"); add_asm_line(aw, wrapper_name + ":"); + // Note that when there's a post condition call, + // the prologue needs to undo the `pushq`s added in `emit_prologue` to save the register params. emit_prologue(aw, caller_pkey, target_pkey, arch, target_post_condition_name.has_value()); if (arch == Arch::X86) {