Fixed regression on ARM caused by the changed behaviour of noStackFrame in commit ac474a2812.
This commit is contained in:
parent
eb4f012239
commit
199c4d21bd
3 changed files with 6 additions and 5 deletions
|
|
@ -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
|
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
|
statements like ``return result;`` generated and the generated C function is
|
||||||
declared as ``__declspec(naked)`` or ``__attribute__((naked))`` (depending on
|
declared as ``__declspec(naked)`` or ``__attribute__((naked))`` (depending on
|
||||||
the used C compiler). This is useful for procs that only consist of an
|
the used C compiler).
|
||||||
assembler statement.
|
|
||||||
|
|
||||||
|
**Note**: This pragma should only be used by procs which consist solely of assembler
|
||||||
|
statements.
|
||||||
|
|
||||||
error pragma
|
error pragma
|
||||||
------------
|
------------
|
||||||
|
|
|
||||||
|
|
@ -1791,7 +1791,7 @@ when defined(JS):
|
||||||
|
|
||||||
elif hostOS != "standalone":
|
elif hostOS != "standalone":
|
||||||
{.push stack_trace:off, profiler:off.}
|
{.push stack_trace:off, profiler:off.}
|
||||||
proc add*(x: var string, y: cstring) {.noStackFrame.} =
|
proc add*(x: var string, y: cstring) =
|
||||||
var i = 0
|
var i = 0
|
||||||
while y[i] != '\0':
|
while y[i] != '\0':
|
||||||
add(x, y[i])
|
add(x, y[i])
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ static int cvariable = 420;
|
||||||
|
|
||||||
""".}
|
""".}
|
||||||
|
|
||||||
proc embedsC() {.noStackFrame.} =
|
proc embedsC() =
|
||||||
var nimrodVar = 89
|
var nimrodVar = 89
|
||||||
{.emit: """fprintf(stdout, "%d\n", cvariable + (int)`nimrodVar`);""".}
|
{.emit: """printf("%d\n", cvariable + (int)`nimrodVar`);""".}
|
||||||
|
|
||||||
embedsC()
|
embedsC()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue