From 6ffad6c1458ed20eccdb7c7079d9747bd1bccaa3 Mon Sep 17 00:00:00 2001 From: Drahflow Date: Wed, 1 Jul 2015 22:43:21 +0200 Subject: Wrap ffi-returned strings without crashing Apparently internalAllocate now (as is permitted) modifies rcx. The buggy code was not prepared to deal with it. --- elymas/lib/sys/so.ey | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elymas/lib/sys/so.ey b/elymas/lib/sys/so.ey index 5c65ccf..029d446 100644 --- a/elymas/lib/sys/so.ey +++ b/elymas/lib/sys/so.ey @@ -204,9 +204,11 @@ :repnz :scasb /rcx :negqReg 2 /rcx :subqImm8Reg + /rcx :pushqReg /rcx /rdi :movqRegReg ::internalAllocateString /rax :movqImmReg /rax :callqReg + /rcx :popqReg /rsi :popqReg /rax :pushqReg 24 /rax /rdi :leaqMemDisp8Reg -- cgit v1.2.3