Is this the right place to report errors in AngelScript?
I have found a compile error that affects both v2.31.2 and the latest svn. I am using gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 running on Lubuntu 16.04.3 LTS. The error is in as_callfunc_x64_gcc.cpp. Without address sanitizer, the file compiles correctly, but with address sanitizer, I get the following error message:
angelscript/source/as_callfunc_x64_gcc.cpp: In function ‘asQWORD X64_CallFunction(const asQWORD*, int, funcptr_t, asQWORD&, bool)’:
angelscript/source/as_callfunc_x64_gcc.cpp:162:82: error: ‘asm’ operand has impossible constraints
"%rdi", "%rsi", "%rax", "%rdx", "%rcx", "%r8", "%r9", "%r10", "%r11", "%r15");
^
The root cause appears to be register exhaustion due to address sanitizer reserving some registers for its own use. Changing the "r" constraints on the input parameters to "g" constraints appears to fix the problem:
Index: angelscript/source/as_callfunc_x64_gcc.cpp
===================================================================
--- angelscript/source/as_callfunc_x64_gcc.cpp (revision 2407)
+++ angelscript/source/as_callfunc_x64_gcc.cpp (working copy)
@@ -157,7 +157,7 @@
" movq %%rdx, %4 \n"
"endcall: \n"
- : : "r" ((asQWORD)cnt), "r" (args), "r" (func), "m" (retQW1), "m" (retQW2), "m" (returnFloat)
+ : : "g" ((asQWORD)cnt), "g" (args), "g" (func), "m" (retQW1), "m" (retQW2), "m" (returnFloat)
: "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7",
"%rdi", "%rsi", "%rax", "%rdx", "%rcx", "%r8", "%r9", "%r10", "%r11", "%r15");