diff --git a/core/vm/arch/jit/jit_common.cpp b/core/vm/arch/jit/jit_common.cpp index 5335e5a21b..58d62d5801 100644 --- a/core/vm/arch/jit/jit_common.cpp +++ b/core/vm/arch/jit/jit_common.cpp @@ -237,9 +237,9 @@ void JitCompiler::JitStackCallback(const long instr_id, StackInstr* instr, const conv = formatter.str(); } - const size_t max = conv.size() < 32 ? conv.size() : 32; + const size_t max = str_ptr[0]; #ifdef _WIN32 - wcsncpy_s(str, str_ptr[0], conv.c_str(), max); + wcsncpy_s(str, str_ptr[0] + 1, conv.c_str(), max); #else wcsncpy(str, conv.c_str(), max); #endif diff --git a/programs/tests/prgm287.obs b/programs/tests/prgm287.obs index fa21e90eea..30e02b2073 100644 --- a/programs/tests/prgm287.obs +++ b/programs/tests/prgm287.obs @@ -1,18 +1,5 @@ class Test { function : Main(args : String[]) ~ Nil { - str := "𤭢"; - System.IO.Standard->SetIntFormat(System.Number->Format->HEX); - u8str := str->ToByteArray(); - each(b in u8str) { - b->ToHexString()->Print(); - " "->Print(); - } - ""->PrintLine(); - u16str := str->ToCharArray(); - each(i in u16str) { - c : Int := i; - c->Print(); - " "->Print(); - } + -1->ToHexString()->Print(); } } \ No newline at end of file