From 22f65d60996958f028620e3effac4bf79a375c12 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Mon, 29 Apr 2024 18:32:31 +0200 Subject: [PATCH] Fix handling of inline asm (#337) * Add failing test * Fixes #333 * Fix test * Mark test and failing rebuild --- lib/AST/IRToASTVisitor.cpp | 2 +- tests/tools/decomp/failing-rebuild/issue_333_inline_asm.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 tests/tools/decomp/failing-rebuild/issue_333_inline_asm.c diff --git a/lib/AST/IRToASTVisitor.cpp b/lib/AST/IRToASTVisitor.cpp index 1dea0a47..324878c7 100755 --- a/lib/AST/IRToASTVisitor.cpp +++ b/lib/AST/IRToASTVisitor.cpp @@ -1236,7 +1236,7 @@ void IRToASTVisitor::VisitFunctionDecl(llvm::Function &func) { } auto fdecl{decl->getAsFunction()}; - fdecl->setParams(params); + fdecl->setParams(iasm_params); tudecl->addDecl(decl); } diff --git a/tests/tools/decomp/failing-rebuild/issue_333_inline_asm.c b/tests/tools/decomp/failing-rebuild/issue_333_inline_asm.c new file mode 100644 index 00000000..9d7bd3db --- /dev/null +++ b/tests/tools/decomp/failing-rebuild/issue_333_inline_asm.c @@ -0,0 +1 @@ +int main(int argc, char *argv[]) { __asm__(""); }