From d78125c6b6310bd9f6ed50f874bdcb51d2b838b0 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Mon, 22 Sep 2014 22:16:55 +0200 Subject: [PATCH] have asfilter deal with tail calls to toolbox functions (preventing undefined __magic_inline errors, see issue #2) --- ASFilter/asfilter.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ASFilter/asfilter.cc b/ASFilter/asfilter.cc index d7f954ccee..f514d4639c 100644 --- a/ASFilter/asfilter.cc +++ b/ASFilter/asfilter.cc @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) std::ofstream out(tempFileName); std::string wordS = "[0-9a-f][0-9a-f][0-9a-f][0-9a-f]"; - rx::regex jsr("\tjsr __magic_inline_(" + wordS + "(_" + wordS + ")*)"); + rx::regex jsr("\t(jsr|jra) __magic_inline_(" + wordS + "(_" + wordS + ")*)"); rx::regex word(wordS); rx::regex rts("\trts"); rx::regex instruction("\t[a-z]+.*"); @@ -98,6 +98,11 @@ int main(int argc, char *argv[]) { out << "\tdc.w 0x" << p->str() << std::endl; } + if(match[1] == "jra") + { + out << "rts\n"; + hadRts = true; + } } // ******* 2. strip unneeded extra rts from "# macsbug symbol" paragraphs