mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
Fixed regression on ARM caused by the changed behaviour of noStackFrame in commit ac474a2812.
This commit is contained in:
@@ -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
|
||||
------------
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user