From 199c4d21bdb75f9faa63c3e470ac69559c14e411 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 19 Oct 2013 21:01:32 +0100 Subject: [PATCH] Fixed regression on ARM caused by the changed behaviour of noStackFrame in commit ac474a28120. --- doc/manual.txt | 5 +++-- lib/system.nim | 2 +- tests/run/temit.nim | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 29b51321e..4351d7232 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -4673,9 +4673,10 @@ A proc can be marked with the `noStackFrame`:idx: pragma to tell the compiler it should not generate a stack frame for the proc. There are also no exit statements like ``return result;`` generated and the generated C function is declared as ``__declspec(naked)`` or ``__attribute__((naked))`` (depending on -the used C compiler). This is useful for procs that only consist of an -assembler statement. +the used C compiler). +**Note**: This pragma should only be used by procs which consist solely of assembler +statements. error pragma ------------ diff --git a/lib/system.nim b/lib/system.nim index 174912519..d29479184 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1791,7 +1791,7 @@ when defined(JS): elif hostOS != "standalone": {.push stack_trace:off, profiler:off.} - proc add*(x: var string, y: cstring) {.noStackFrame.} = + proc add*(x: var string, y: cstring) = var i = 0 while y[i] != '\0': add(x, y[i]) diff --git a/tests/run/temit.nim b/tests/run/temit.nim index 460bc3443..ff8df0585 100644 --- a/tests/run/temit.nim +++ b/tests/run/temit.nim @@ -9,9 +9,9 @@ static int cvariable = 420; """.} -proc embedsC() {.noStackFrame.} = +proc embedsC() = var nimrodVar = 89 - {.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".} + {.emit: """printf("%d\n", cvariable + (int)`nimrodVar`);""".} embedsC()