1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-20 09:15:12 +00:00

Address #1005 - Fix janet_call stack clobbering on dirty stack.

This commit is contained in:
Calvin Rose
2022-08-02 12:13:22 -05:00
parent f443a3b3a1
commit 79c375b1af
2 changed files with 22 additions and 0 deletions

View File

@@ -437,6 +437,8 @@ static Janet cfun_io_print_impl_x(int32_t argc, Janet *argv, int newline,
if (newline)
janet_buffer_push_u8(buf, '\n');
Janet args[1] = { janet_wrap_buffer(buf) };
/* Disable tracing */
fun->gc.flags &= ~JANET_FUNCFLAG_TRACE;
janet_call(fun, 1, args);
return janet_wrap_nil();
}
@@ -552,6 +554,8 @@ static Janet cfun_io_printf_impl_x(int32_t argc, Janet *argv, int newline,
janet_buffer_format(buf, fmt, offset, argc, argv);
if (newline) janet_buffer_push_u8(buf, '\n');
Janet args[1] = { janet_wrap_buffer(buf) };
/* Disable tracing */
fun->gc.flags &= ~JANET_FUNCFLAG_TRACE;
janet_call(fun, 1, args);
return janet_wrap_nil();
}