WheretIB / nullc

Fast C-like programming language with advanced features
MIT License
162 stars 12 forks source link

Some tests fail on arm32 #35

Open mingodad opened 1 year ago

mingodad commented 1 year ago

While testing this project on arm32 (android with termux clang9) I'm getting this errors:

External function call. Class types sizeof() == 0, arguments in registers. sx [raw]
REGVM Failed (0 != 1)
External function call. Floating point register overflow mid argument. [raw]
REGVM Failed (0 != 1)
External function call. auto ref. { int; } returned. [raw]
REGVM Failed (0 != 1)
External function call. Small return type 1. [raw]
REGVM Failed (0 != 1)
nullc compiler
REGVM Execution failed: buffer is empty
Call stack:
global scope (line 30: at BuildBaseModule(2);)
BuildBaseModule (line 204: at if(!BuildModuleFromSource(string("$base$.nc"), string(), string(nullcBaseCode), &errorPos, &errorBuf, optimizationLevel, ArrayView<InplaceStr>())))
BuildModuleFromSource (line 1982: at if(!CompileModuleFromSource(ctx)))
CompileModuleFromSource (line 494: at if(!AnalyzeModuleFromSource(ctx)))
AnalyzeModuleFromSource (line 470: at PrintGraph(exprGraphCtx, ctx.exprModule, "");)
PrintGraph (line 1132: at PrintGraph(ctx, expression, InplaceStr(name));)
PrintGraph (line 1088: at PrintGraph(ctx, node.moduleScope, true);)
PrintGraph (line 501: at PrintGraph(ctx, data, printImported);)
PrintGraph (line 447: at PrintIndented(ctx, InplaceStr(), data.type, "%.*s: f%04x", FMT_ISTR(data.name.name), data.uniqueId);)
FMT_ISTR (line 253: at memory::copy(result, 0, str.data, str.begin, str.length());)

Eval test finished in 669.075000
std.string test (raw character array operation)
REGVM Execution failed: Assertion failed
Call stack:
global scope (line 38: at return __runner();)
__runner (line 26: at assert(strcmp("zz", "test") > 1);)

The strcmp one is interesting because it return 6 on linux x86_64 when running through nullc but returns 1 when running through a C test program:

import std.io;
import std.string;

int rc = strcmp("zz", "test");

io.out << rc << io.endl;

return 0;
#include <stdio.h>
#include <string.h>

int main () {
   char str1[15];
   char str2[15];
   int ret, ret2;

   strcpy(str1, "abcdef");
   strcpy(str2, "ABCDEF");

   ret = strcmp(str1, str2);
   printf("ret = %d\n", ret);

   ret2 = strcmp("zz", "test");
   printf("strcmp zz test = %d\n", ret2);

   if(ret < 0) {
      printf("str1 is less than str2");
   } else if(ret > 0) {
      printf("str2 is less than str1");
   } else {
      printf("str1 is equal to str2");
   }

   return(0);
}

Output:

./run-it test-strcmp.nc 
6
0.03user 0.00system 0:00.03elapsed 100%CPU (0avgtext+0avgdata 11836maxresident)k
0inputs+0outputs (0major+2176minor)pagefaults 0swaps

gcc -o test-strcmp test-strcmp.c 
./test-strcmp
ret = 32
strcmp zz test = 1
str2 is less than str1

But nullc on arm32 return 1:

./run-it test-strcmp.nc 
1

real    0m0.289s
user    0m0.240s
sys 0m0.040s

gcc -o test-strcmp test-strcmp.c
./test-strcmp
ret = 32
strcmp zz test = 1
str2 is less than str1
mingodad commented 1 year ago

And more interesting is that on linux x86_64 under valgrind nullc return 1 instead of 6:

valgrind ../bin/nullc_exec test-strcmp.nc 
==17739== Memcheck, a memory error detector
==17739== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==17739== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==17739== Command: ../bin/nullc_exec test-strcmp.nc
==17739== 
1
==17739== 
==17739== HEAP SUMMARY:
==17739==     in use at exit: 0 bytes in 0 blocks
==17739==   total heap usage: 459 allocs, 459 frees, 10,470,647 bytes allocated
==17739== 
==17739== All heap blocks were freed -- no leaks are possible
==17739== 
==17739== For lists of detected and suppressed errors, rerun with: -s
==17739== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

../bin/nullc_exec test-strcmp.nc 
6
mingodad commented 1 year ago

And here is the output of make test on linux 32bits i686:

bin/nullcl -o bin/nullclib.ncm Modules/img/canvas.nc -m img.canvas Modules/win/window_ex.nc -m win.window_ex Modules/win/window.nc -m win.window Modules/std/algorithm.nc -m std.algorithm  Modules/std/typeinfo.nc -m std.typeinfo Modules/std/file.nc -m std.file Modules/std/io.nc -m std.io Modules/std/string.nc -m std.string Modules/std/vector.nc -m std.vector Modules/std/list.nc -m std.list Modules/std/map.nc -m std.map Modules/std/hashmap.nc -m std.hashmap Modules/std/math.nc -m std.math Modules/std/time.nc -m std.time Modules/std/random.nc -m std.random Modules/std/range.nc -m std.range Modules/std/gc.nc -m std.gc Modules/std/dynamic.nc -m std.dynamic Modules/ext/pugixml.nc -m ext.pugixml
./bin/TestRun
Failed namespace error but for wrong reason:
    ERROR: return statement must be followed by an expression or ';'
expected:
    ERROR: unknown identifier 'Nested'
Failed fuzzing test crash but for wrong reason:
    ERROR: '(' expected after function name
expected:
    ERROR: ')' not found after function variable list
Group of tests 5
X86 Failed (0 != 2)
Global variable alignment
X86 Failed (0 != 1)
Array alignment 2
X86 Failed (0 != 1)
Array alignment 3
REGVM Failed (2 != 3)
Array alignment 3
X86 Failed (2 != 3)
nullc compiler
REGVM Execution failed: buffer is empty
Call stack:
global scope (line 30: at BuildBaseModule(2);)
BuildBaseModule (line 204: at if(!BuildModuleFromSource(string("$base$.nc"), string(), string(nullcBaseCode), &errorPos, &errorBuf, optimizationLevel, ArrayView<InplaceStr>())))
BuildModuleFromSource (line 1982: at if(!CompileModuleFromSource(ctx)))
CompileModuleFromSource (line 494: at if(!AnalyzeModuleFromSource(ctx)))
AnalyzeModuleFromSource (line 470: at PrintGraph(exprGraphCtx, ctx.exprModule, "");)
PrintGraph (line 1132: at PrintGraph(ctx, expression, InplaceStr(name));)
PrintGraph (line 1088: at PrintGraph(ctx, node.moduleScope, true);)
PrintGraph (line 501: at PrintGraph(ctx, data, printImported);)
PrintGraph (line 447: at PrintIndented(ctx, InplaceStr(), data.type, "%.*s: f%04x", FMT_ISTR(data.name.name), data.uniqueId);)
FMT_ISTR (line 253: at memory::copy(result, 0, str.data, str.begin, str.length());)

Eval test finished in 79.942000
Eval test finished in 165.208000
std.string test (raw character array operation)
REGVM Execution failed: Assertion failed
Call stack:
global scope (line 38: at return __runner();)
__runner (line 26: at assert(strcmp("zz", "test") > 1);)

std.string test (raw character array operation)
X86 Execution failed: Assertion failed
Call stack:
global scope (line 38: at return __runner();)
__runner (line 26: at assert(strcmp("zz", "test") > 1);)

Expr Evaluated 4522 of 4522 tests
Inst Evaluated 4556 of 4556 tests
X86 passed 1647 of 1652 tests
RegVM passed 1659 of 1662 tests
Failure tests: passed 790 of 792 tests
Extra tests: passed 418 of 418 tests
Translation tests: passed 0 of 0 tests
Compilation time: 7806.961000
Get bytecode time: 461.290000
Tree visit time: 234.670000
Expression evaluation time: 614.745000
Instruction evaluation time: 757.611000
Translation time: 2.710000
Clean time: 205.707000
Link time: 4114.713000
Run time: 1055.049000
Total time: 15253.456000
Total log output: 4612
Total nodes: 688843 syntax, 1481067 expression
Total RegVM instructions: 581868
Total optimizations: peephole        103003 const-prop    40178 dead-code-elim  323175 cflow-simp   78674
                   : load-store-prop 132762 subexpr-elim  18029 dead-store-elim  16972 func-inline      0
Total global allocs: 126401 (1673.996MB requested)
Passed 13592 of 13602 tests
make: *** [test] Error 1
mingodad commented 1 year ago

The previous test were done with my fork, here is the result for a fresh clone of this repo:

Char array test
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 3: at auto str1 = "", str2 = "a", str3 = "ab";)

Char array test 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 3: at arr[0] = "hehe";)

Escape sequences
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 3: at auto name = "01n";)

Print test
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 2: at auto ts = "Hello World!\r\noh\toh\r\n";)

Multidimensional array constructor test
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 44: at return __runner();)
__runner (line 33: at auto a = { 3, 4, 5 };)

Creation of temporary array on heap 3
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 15: at return __runner();)
__runner (line 9: at auto t = "hello there";)

Array to auto[] type conversion and access 1.
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto str = "Hello"; auto[] arr = str; return char(arr[3]) - 'l';)

Array to auto[] type conversion and access 2.
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at char[6] str = "Hello"; auto[] arr = str; return char(arr[3]) - 'l';)

auto[] type to array conversion 1
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto str = "Hello"; auto[] arr = str; char[] str2 = arr; return str == str2;)

auto[] type to array conversion 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto str = "Hello"; auto[] arr = str; char[6] str2 = arr; return str == str2;)

auto[] type to auto[] assignment
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto str = "Hello"; auto[] arr = str; auto[] arr2 = arr; char[] str2 = arr; char[] str3 = arr2; return str2 == str3;)

auto ref type function call 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 92: at return __runner();)
__runner (line 77: at p.points = { Point(40, 50), Point(30, 20), Point(40, 80), Point(140, 300), Point(600, 20) };)

Function call through 'auto ref', selection of a variable argument function
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 9: at return __runner();)
__runner (line 7: at return x.boo(1, 2, 3) + x.boo(1, 2);)

L-value extended cases
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 13: at return __runner();)
__runner (line 4: at auto k = { 3, 4, 9 };)

Unescaped string literal
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 2: at auto x = @"\r\n\thello\0"; return x.size + (x[1] == 'r');)

new call with function type
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 12: at return __runner();)
__runner (line 5: at auto a = { 1, 2, 3, 4, 5 };)

new call with typeof
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 12: at return __runner();)
__runner (line 5: at auto a = { 1, 2, 3, 4, 5 };)

Value construction of a derived type 1
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 2: at auto a = { 1, 2 }; auto ay = new (int[2])(a); return ay[0] + ay[1];)

Unary operator overloading 1
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 13: at return __runner();)
__runner (line 6: at int[4] arr = { 13, 17, 21, 25 };)

Array index overload call for pointer to array type
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 9: at return __runner();)
__runner (line 2: at auto arr = { 100, 200, 300, 400 };)

overloaded operator in variable definition is called before implicit conversions
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 2: at auto x = { 1, 2, 3, 4 };)

Coroutine 15 (for each loop is the same as a regular loop).
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 30: at return __runner();)
__runner (line 2: at int[3] arr = { 5, 6, 7 };)

Post expressions on arrays and strings
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 31: at return __runner();)
__runner (line 17: at int l = ("Pota" + "to").find('a');)

Prefix and postfix expressions on expression in parentheses 2.
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 2: at int x = 1, y = 9, z = 101, w = 1001;)

External function call. int[] argument in registers. [raw]
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 4: at int[2] arr = { 1, 2 };)

External function call. Complex return, arguments in registers. [raw]
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 4: at int[2] arr = { 1, 0 };)

External function call. int[] argument in registers. [wrap]
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 4: at int[2] arr = { 1, 2 };)

External function call. Complex return, arguments in registers. [wrap]
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 4: at int[2] arr = { 1, 0 };)

File and something else test
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 17: at return __runner();)
__runner (line 7: at auto uh = "ehhhe";)

File test 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 48: at return __runner();)
__runner (line 5: at auto name = "extern.bin";)

Array out of bounds error check 3 [failure handling]
Failed but for wrong reason:
    ERROR: null pointer access
expected:
    ERROR: array index out of bounds
auto[] type underflow [failure handling]
Failed but for wrong reason:
    ERROR: null pointer access
expected:
    ERROR: array index out of bounds
auto[] type overflow 2 [failure handling]
Failed but for wrong reason:
    ERROR: null pointer access
expected:
    ERROR: array index out of bounds
auto[] type conversion mismatch 2 [failure handling]
Failed but for wrong reason:
    ERROR: null pointer access
expected:
    ERROR: cannot convert from 'auto[]' (actual type 'char[6]') to 'char[7]'
auto[] type conversion mismatch 3 [failure handling]
Failed but for wrong reason:
    ERROR: null pointer access
expected:
    ERROR: cannot convert from 'auto[]' (actual type 'char[6]') to 'int[]'
Group of tests 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 2: at auto a = {1,2,3,4};)

Group of tests 5
X86 Failed (0 != 2)
Global variable alignment
X86 Failed (0 != 1)
Array alignment 2
X86 Failed (0 != 1)
Array alignment 3
REGVM Failed (2 != 3)
Array alignment 3
X86 Failed (2 != 3)
Fuzzing crash result 9 (array boxing to auto ref)
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 5: at return __runner();)
__runner (line 37: at char[] double:str(int precision = 6, bool showExponent = false);)

Fuzzing crash result 20 (array element store between different blocks still requires dtof instruction removal)
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 168: at void __closeUpvalue(void ref ref l, void ref v, int offset, int size);)

Manual type cast 1
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto s = "hello"; char[] b = char[](s); return b[2];)

Manual type cast 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto s = "hello"; char[] b = (char[])(s); return b[2];)

Large value copy aliasing 1
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 27: at return __runner();)
__runner (line 25: at return test5() + test7();)
test5 (line 12: at Big a, b; a.b.x = 5; return test4(a, b).b.x;)
test4 (line 7: at Big c = a; a.a = a.b; return c;)

Large value copy aliasing 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 41: at return __runner();)
__runner (line 39: at return (test1() == 0) + (test2() == 3) + (test3() == 3) + (test4().y == 2) + (test5(test4()).y == 2) + (test6() == 1) + (test7() == 6);)
test1 (line 6: at Large a, b; a.x = 1; a.y = 2; a = b; return a.x + a.y;)

Large value conditionals
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 11: at return __runner();)
__runner (line 8: at Huge a = b.b[2].x ? b : c;)

Array lowering check 3
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 7: at return __runner();)
__runner (line 2: at auto arr3 = { 1, 2, 5, 10, 20, 50, 100, 200 };)

Array lowering check 4
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 18: at return __runner();)
__runner (line 2: at auto names = {)

Array lowering check 5
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 60: at return __runner();)
__runner (line 8: at auto arr1b = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };)

Array lowering check 6
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 3: at auto arr11 = { -1, -1 - 1, -3, -2 * 2, -5, -12 / 2, -7, -(16 >> 1), -9 };)

Array lowering check 7
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 6: at return __runner();)
__runner (line 4: at return b(true);)
b (line 3: at int b(bool ctx){ return a(ctx ? char[]("a, ") : char[](""), ctx ? char[]("b, ") : char[](""), ctx ? char[]("c, ") : char[]("")); })

Dead instruction in load store propagation
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 3: at auto arr8 = "bcdefghij";)

Conditional with a complex value 1
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 2: at auto x = 1 ? "aaa" : "bbb"; return x[0] - 'a';)

Conditional with a complex value 2
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 4: at return __runner();)
__runner (line 2: at auto y = new int(1); auto x = *y ? "aaa" : "bbb"; return x[0] - 'a';)

Lowering of struct value constants
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 53: at return __runner();)
__runner (line 46: at sum += foo31(<x>{ int sum; for(i in x) sum += i; sum; });)
foo31 (line 9: at int foo31(int ref(int[31]) f) { int[31] x; x = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}; return f(x); })

For each for standard arrays
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 28: at return __runner();)
__runner (line 7: at int[3] arr2 = { 2, 6, 7 };)

For each with multiple arrays
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 12: at return __runner();)
__runner (line 3: at for(i in { 1, 2, 3 }, j in { 4, 5, 6, 7 }))

Pattern matching
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 88: at return __runner();)
__runner (line 82: at int d = int(fib(1));)

Functional primitives
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 181: at return __runner();)
__runner (line 132: at int a = add(3, 4); // 7)

AABB transformations
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 174: at return __runner();)
__runner (line 165: at r += transform_aabb(aabb_, matrix).min.y;)
transform_aabb (line 87: at {)

Big integer value passing
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 315: at return __runner();)
__runner (line 303: at a = a * 2 * 2 * 5 * 7 * 19 * 23 * 23 * 47 * 47;)

nullc compiler
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 15: at auto nullcBaseCode = @")

example of sum of integers using function with variable arguments
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 11: at return __runner();)
__runner (line 9: at return sum(1, 12, 201);)

example of println function
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 27: at return __runner();)
__runner (line 25: at return println(2, " ", 4, " hello ", 5.0, 3.0f);)

Check for bug in GC with allocating pointers to arrays
REGVM Execution failed: ERROR: null pointer access
Call stack:
global scope (line 24: at foo(omm(), omg(), omm());)
omm (line 18: at *x = { Foo(), Foo(), Foo(), Foo() };)

Eval test finished in 82.838000
Eval test finished in 165.930000
Expr Evaluated 4398 of 4398 tests
Inst Evaluated 4448 of 4448 tests
X86 passed 1637 of 1641 tests
RegVM passed 1600 of 1663 tests
Failure tests: passed 792 of 792 tests
Extra tests: passed 418 of 418 tests
Translation tests: passed 0 of 0 tests
Compilation time: 7723.168000
Get bytecode time: 468.320000
Tree visit time: 228.573000
Expression evaluation time: 543.726000
Instruction evaluation time: 700.297000
Translation time: 2.768000
Clean time: 207.340000
Link time: 4076.641000
Run time: 988.479000
Total time: 14939.312000
Total log output: 4612
Total nodes: 659371 syntax, 1403034 expression
Total RegVM instructions: 548374
Total optimizations: peephole         97168 const-prop    38860 dead-code-elim  312246 cflow-simp   75846
                   : load-store-prop 124003 subexpr-elim  16076 dead-store-elim  16224 func-inline      0
Total global allocs: 121692 (1636.793MB requested)
Passed 13293 of 13360 tests
Command exited with non-zero status 1
15.19user 0.34system 0:15.55elapsed 99%CPU (0avgtext+0avgdata 183864maxresident)k
0inputs+312outputs (0major+38635minor)pagefaults 0swaps
==2057== Memcheck, a memory error detector
==2057== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==2057== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==2057== Command: bin/TestRun
==2057== 
==2057== Conditional jump or move depends on uninitialised value(s)
==2057==    at 0x8328003: ExecutorX86::TranslateToNative(bool, OutputContext&) (Executor_X86.cpp:1836)
==2057==    by 0x82CB1AE: nullcLinkCodeWithModuleName (nullc.cpp:770)
==2057==    by 0x82CAFF5: nullcLinkCode (nullc.cpp:717)
==2057==    by 0x81CE9EC: RunInterfaceTests() (TestInterface.cpp:79)
==2057==    by 0x81C40C8: RunTests(bool, char const* (*)(char const*, unsigned int*), void (*)(char const*), bool, bool, bool, bool, bool) (UnitTests.cpp:264)
==2057==    by 0x81C3B0B: main (TestRun.cpp:41)
==2057== 
==2057== Invalid read of size 4
==2057==    at 0x471FFFF: ???
==2057==    by 0x42A4EE5: ???
==2057==    by 0x8326271: ExecutorX86::Run(unsigned int, char const*) (Executor_X86.cpp:1017)
==2057==    by 0x82CB70A: nullcRunFunctionInternal (nullc.cpp:1047)
==2057==    by 0x82CB6B7: nullcRunFunction (nullc.cpp:1034)
==2057==    by 0x81CEE29: RunInterfaceTests() (TestInterface.cpp:195)
==2057==    by 0x81C40C8: RunTests(bool, char const* (*)(char const*, unsigned int*), void (*)(char const*), bool, bool, bool, bool, bool) (UnitTests.cpp:264)
==2057==    by 0x81C3B0B: main (TestRun.cpp:41)
==2057==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==2057== 
TestRun: NULLC/Executor_Common.cpp:1782: long long int GetExecutorResultLong(unsigned int, unsigned int*): Assertion `!"return type is not 'long'"' failed.
Execution failed: ERROR: null pointer access
Call stack:
foo (line 37: at char[] double::str(int precision = 6, bool showExponent = false);)

X86 failed test: Function update test
Execution failed: ERROR: null pointer access
Call stack:
foo (line 37: at char[] double::str(int precision = 6, bool showExponent = false);)

X86 failed test: Function update test 2
nullcRunFunction(Char) failed: ERROR: null pointer access
Call stack:
Char (line 37: at char[] double::str(int precision = 6, bool showExponent = false);)

X86 failed test: Value pass through nullcCallFunction
==2057== 
==2057== HEAP SUMMARY:
==2057==     in use at exit: 4,315,556 bytes in 149 blocks
==2057==   total heap usage: 362 allocs, 213 frees, 6,186,523 bytes allocated
==2057== 
==2057== LEAK SUMMARY:
==2057==    definitely lost: 0 bytes in 0 blocks
==2057==    indirectly lost: 0 bytes in 0 blocks
==2057==      possibly lost: 0 bytes in 0 blocks
==2057==    still reachable: 4,315,556 bytes in 149 blocks
==2057==         suppressed: 0 bytes in 0 blocks
==2057== Rerun with --leak-check=full to see details of leaked memory
==2057== 
==2057== For counts of detected and suppressed errors, rerun with: -v
==2057== Use --track-origins=yes to see where uninitialised values come from
==2057== ERROR SUMMARY: 93 errors from 2 contexts (suppressed: 0 from 0)
mingodad commented 1 year ago

The null pointer access problem seem to be fixed adding missing casts:

--------------------------- NULLC/Executor_RegVm.cpp ---------------------------
index 6eff9b6e..cc469051 100644
@@ -751,10 +751,10 @@ RegVmReturnType ExecutorRegVm::RunCode(RegVmCmd *instruction, RegVmRegister * co
            instruction++;
            BREAK;
        CASE(rviMemCopy)
-           if(regFilePtr[cmd.rA].ptrValue < 0x00010000)
+           if((uintptr_t)regFilePtr[cmd.rA].ptrValue < 0x00010000)
                return rvm->ExecError(instruction, "ERROR: null pointer access");

-           if(regFilePtr[cmd.rC].ptrValue < 0x00010000)
+           if((uintptr_t)regFilePtr[cmd.rC].ptrValue < 0x00010000)
                return rvm->ExecError(instruction, "ERROR: null pointer access");

            memcpy((void*)regFilePtr[cmd.rA].ptrValue, (void*)regFilePtr[cmd.rC].ptrValue, cmd.argument);
mingodad commented 1 year ago

This seems to fix this test for both 64/32 bits:

const char  *testAlignment3 =
"import test.alignment;\r\n\
class X{ double x; int y; }\r\n\
class Y{ X x; int y; }\r\n\
Y y;\r\n\
return CheckAlignment(&y.x.x, "
#ifdef _M_X64
    "8"
#else
    "4"
#endif
") + CheckAlignment(&y.x.y, 4) + CheckAlignment(&y.y, 4);";
TEST_RESULT("Array alignment 3", testAlignment3, "3");
mingodad commented 1 year ago

Here is the output of bin/TestRun with valgrind:

valgrind bin/TestRun
==16083== Memcheck, a memory error detector
==16083== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==16083== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==16083== Command: bin/TestRun
==16083== 
==16083== Conditional jump or move depends on uninitialised value(s)
==16083==    at 0x502B7B: ExecutorX86::TranslateToNative(bool, OutputContext&) (Executor_X86.cpp:1831)
==16083==    by 0x494E5E: nullcLinkCodeWithModuleName (nullc.cpp:770)
==16083==    by 0x494C6E: nullcLinkCode (nullc.cpp:717)
==16083==    by 0x360833: RunInterfaceTests() (TestInterface.cpp:79)
==16083==    by 0x352F0F: RunTests(bool, char const* (*)(char const*, unsigned int*), void (*)(char const*), bool, bool, bool, bool, bool) (UnitTests.cpp:264)
==16083==    by 0x3528C1: main (TestRun.cpp:41)
==16083== 
==16083== Conditional jump or move depends on uninitialised value(s)
==16083==    at 0x502B7B: ExecutorX86::TranslateToNative(bool, OutputContext&) (Executor_X86.cpp:1831)
==16083==    by 0x494E5E: nullcLinkCodeWithModuleName (nullc.cpp:770)
==16083==    by 0x494C6E: nullcLinkCode (nullc.cpp:717)
==16083==    by 0x36BBD3: Tests::RunCodeSimple(char const*, unsigned int, char const*, char const*, bool, char const*) (TestBase.cpp:619)
==16083==    by 0x36AB65: Tests::RunCode(char const*, unsigned int, char const*, char const*, bool) (TestBase.cpp:318)
==16083==    by 0x354DC6: Test_testAccessors::Run() (TestAccessors.cpp:18)
==16083==    by 0x3543A0: TestQueue::RunTests() (TestBase.h:58)
==16083==    by 0x352FF9: RunTests(bool, char const* (*)(char const*, unsigned int*), void (*)(char const*), bool, bool, bool, bool, bool) (UnitTests.cpp:312)
==16083==    by 0x3528C1: main (TestRun.cpp:41)
==16083== 
Eval test finished in 3005.339000
==16083== Conditional jump or move depends on uninitialised value(s)
==16083==    at 0x502B7B: ExecutorX86::TranslateToNative(bool, OutputContext&) (Executor_X86.cpp:1831)
==16083==    by 0x494E5E: nullcLinkCodeWithModuleName (nullc.cpp:770)
==16083==    by 0x494C6E: nullcLinkCode (nullc.cpp:717)
==16083==    by 0x4C9BA1: NULLCDynamic::Override(NULLCRef, NULLCArray) (dynamic.cpp:61)
==16083==    by 0x4C9E93: nullc_enable_if<nullc_is_void<void>::value, void>::type nullcWrapCall2<void, NULLCRef, NULLCArray>(void*, char*, char*) (nullbind.h:333)
==16083==    by 0x5B42D4: CallWrap(CodeGenRegVmStateContext*, unsigned int) (CodeGenRegVm_X86.cpp:1814)
==16083==    by 0x626B7DA: ???
==16083==    by 0x3FFFFFFFF: ???
==16083==    by 0x5F7B3D7: ???
==16083==    by 0x6728D8F: ???
==16083==    by 0x721B42F: ???
==16083== 
Eval test finished in 6155.550000
Expr Evaluated 4497 of 4497 tests
Inst Evaluated 4532 of 4532 tests
X86 passed 1639 of 1639 tests
RegVM passed 1649 of 1649 tests
Failure tests: passed 791 of 791 tests
Extra tests: passed 412 of 412 tests
Translation tests: passed 0 of 0 tests
Compilation time: 299312.806000
Get bytecode time: 12207.448000
Tree visit time: 8699.320000
Expression evaluation time: 31180.724000
Instruction evaluation time: 37470.727000
Translation time: 20.889000
Clean time: 3138.880000
Link time: 98507.584000
Run time: 54779.365000
Total time: 545317.743000
Total log output: 4616
Total nodes: 674322 syntax, 1414281 expression
Total RegVM instructions: 559194
Total optimizations: peephole        100179 const-prop    39318 dead-code-elim  312572 cflow-simp   77482
                   : load-store-prop 124938 subexpr-elim  16902 dead-store-elim  16696 func-inline      0
Total global allocs: 147123 (2338.419MB requested)
Passed 13520 of 13520 tests
==16083== 
==16083== HEAP SUMMARY:
==16083==     in use at exit: 0 bytes in 0 blocks
==16083==   total heap usage: 236,764 allocs, 236,764 frees, 3,791,142,456 bytes allocated
==16083== 
==16083== All heap blocks were freed -- no leaks are possible
==16083== 
==16083== Use --track-origins=yes to see where uninitialised values come from
==16083== For lists of detected and suppressed errors, rerun with: -s
==16083== ERROR SUMMARY: 3030 errors from 3 contexts (suppressed: 0 from 0)
mingodad commented 1 year ago

The Conditional jump or move depends on uninitialised value seems to be due to this line (that I'm changing by adding an extra optional parameter bool doZeroMemory=false):

---------------------------- NULLC/Executor_X86.cpp ----------------------------
index 0731514c..a1870614 100644
@@ -1363,7 +1363,7 @@ bool ExecutorX86::TranslateToNative(bool enableLogFiles, OutputContext &output)
    }
    else
    {
-       functionAddress.resize(exFunctions.size());
+       functionAddress.resize(exFunctions.size(), true);
    }
mingodad commented 1 year ago

Now when compiled to 32bits it's failing with this test:

const char  *testDivZeroInt = 
"// Division by zero handling\r\n\
int a = 5, b = 0;\r\n\
return a/b;";
TEST_RUNTIME_FAIL("Division by zero handling 1 [failure handling]", testDivZeroInt, "ERROR: integer division by zero");
mingodad commented 1 year ago

Here is the output of this project with my fixes on arm32 (adding this compiler option -fsigned-char):

bin/TestRun
External function call. Class types sizeof() == 0, arguments in registers. sx [raw]
REGVM Failed (0 != 1)
External function call. Floating point register overflow mid argument. [raw]
REGVM Failed (0 != 1)
External function call. auto ref. { int; } returned. [raw]
REGVM Failed (0 != 1)
External function call. Small return type 1. [raw]
REGVM Failed (0 != 1)
Char loads are sign-extended 1
REGVM Failed (1005 != -19)
Short loads are sign-extended 1
REGVM Failed (509 != -3)
Numeric operations on different types
Instruction evaluation Failed (1148074 != 1148063)
Eval test finished in 725.742000
Expr Evaluated 4491 of 4491 tests
Inst Evaluated 4524 of 4525 tests
RegVM passed 1642 of 1649 tests
Failure tests: passed 791 of 791 tests
Extra tests: passed 394 of 394 tests
Translation tests: passed 0 of 0 tests
Compilation time: 44310.606000
Get bytecode time: 2395.613000
Tree visit time: 1457.513000
Expression evaluation time: 6715.772000
Instruction evaluation time: 7734.220000
Translation time: 14.073000
Clean time: 1000.654000
Link time: 3023.308000
Run time: 7500.841000
Total time: 74152.600000
Total log output: 2306
Total nodes: 335890 syntax, 701309 expression
Total RegVM instructions: 276176
Total optimizations: peephole         49856 const-prop    19319 dead-code-elim  155805 cflow-simp   38638
                   : load-store-prop  61669 subexpr-elim   8443 dead-store-elim   8246 func-inline      0
Total global allocs: 75297 (866.854MB requested)
Passed 11842 of 11850 tests
mingodad commented 1 year ago

This changes fix the loads are sign-extended error on arm:

--------------------------- NULLC/Executor_RegVm.cpp ---------------------------
index 6eff9b6e..6b1f1b13 100644
@@ -612,14 +612,14 @@ RegVmReturnType ExecutorRegVm::RunCode(RegVmCmd *instruction, RegVmRegister * co
            if((uintptr_t)regFilePtr[cmd.rC].ptrValue < 0x00010000)
                return rvm->ExecError(instruction, "ERROR: null pointer access");

-           *(char*)(uintptr_t)(regFilePtr[cmd.rC].ptrValue + cmd.argument) = (char)regFilePtr[cmd.rA].intValue;
+           *(char*)(uintptr_t)(regFilePtr[cmd.rC].ptrValue + cmd.argument) = (signed char)regFilePtr[cmd.rA].intValue;
            instruction++;
            BREAK;
        CASE(rviStoreWord)
            if((uintptr_t)regFilePtr[cmd.rC].ptrValue < 0x00010000)
                return rvm->ExecError(instruction, "ERROR: null pointer access");

-           *(short*)(uintptr_t)(regFilePtr[cmd.rC].ptrValue + cmd.argument) = (short)regFilePtr[cmd.rA].intValue;
+           *(short*)(uintptr_t)(regFilePtr[cmd.rC].ptrValue + cmd.argument) = (signed short)regFilePtr[cmd.rA].intValue;
            instruction++;
            BREAK;
        CASE(rviStoreDword)
@@ -743,7 +743,7 @@ RegVmReturnType ExecutorRegVm::RunCode(RegVmCmd *instruction, RegVmRegister * co
            case rvsrChar:

                for(unsigned i = 0; i < cmd.argument; i++)
-                   ((char*)regFilePtr[cmd.rC].ptrValue)[i] = (char)regFilePtr[cmd.rA].intValue;
+                   ((char*)regFilePtr[cmd.rC].ptrValue)[i] = (signed char)regFilePtr[cmd.rA].intValue;
                break;
            default:
                assert(!"unknown type");
mingodad commented 1 year ago

When building for 64bits on linux in release mode and executing bin/TestRun with valgrind we get this:

==32174== Memcheck, a memory error detector
==32174== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==32174== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
==32174== Command: bin/TestRun
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881ED57: ???
==32174==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 1
==32174==    at 0x881ED8E: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6BF8601: ???
==32174==    by 0x6BF85CF: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B47: ???
==32174==    by 0x881F034: ???
==32174==    by 0x74E27D7: ???
==32174==    by 0x6BF8607: ???
==32174==    by 0x1: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 2
==32174==    at 0x881EDED: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6BF8601: ???
==32174==    by 0x6BF85CF: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B97: ???
==32174==    by 0x881F2C0: ???
==32174==    by 0x74E27D7: ???
==32174==    by 0x6BF8607: ???
==32174==    by 0x1: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EE4C: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6BF8601: ???
==32174==    by 0x6BF85CF: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11BE7: ???
==32174==    by 0x881F46C: ???
==32174==    by 0x74E27D7: ???
==32174==    by 0x6BF8607: ???
==32174==    by 0x1: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EEAA: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6BF8601: ???
==32174==    by 0x6BF85CF: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11C37: ???
==32174==    by 0x881F618: ???
==32174==    by 0x74E27D7: ???
==32174==    by 0x6BF8607: ???
==32174==    by 0x1: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EF0A: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6BF8601: ???
==32174==    by 0x6BF85CF: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11C87: ???
==32174==    by 0x881F7CE: ???
==32174==    by 0x74E27D7: ???
==32174==    by 0x6BF8607: ???
==32174==    by 0x1: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EF74: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6BF8601: ???
==32174==    by 0x6BF85CF: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CD7: ???
==32174==    by 0x881F992: ???
==32174==    by 0x74E27D7: ???
==32174==    by 0x6BF8607: ???
==32174==    by 0x1: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 1
==32174==    at 0x881ED8E: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 1
==32174==    at 0x881EDBB: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 2
==32174==    at 0x881EE46: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 4
==32174==    at 0x881EED2: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 8
==32174==    at 0x881EF64: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 4
==32174==    at 0x881EFFE: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 8
==32174==    at 0x881F099: ???
==32174==    by 0x1FFEFFE2CF: ???
==32174==    by 0x30F8D5: TypeBase (TypeTree.h:673)
==32174==    by 0x30F8D5: TypeFunctionSet (TypeTree.h:1078)
==32174==    by 0x30F8D5: ExpressionContext::GetFunctionSetType(ArrayView<TypeBase*>) (ExpressionTree.cpp:1864)
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 1
==32174==    at 0x881EDBB: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EDB2: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B47: ???
==32174==    by 0x881F6DD: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EE36: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B9F: ???
==32174==    by 0x881F96F: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EEBA: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11BF7: ???
==32174==    by 0x881FB29: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EF46: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11C4F: ???
==32174==    by 0x881FCE3: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EFD3: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CA7: ???
==32174==    by 0x881FE9D: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F059: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CFF: ???
==32174==    by 0x8820057: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F0E4: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11D57: ???
==32174==    by 0x8820211: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F16B: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11DAF: ???
==32174==    by 0x88203CB: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F1F2: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11E07: ???
==32174==    by 0x8820585: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F279: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11E5F: ???
==32174==    by 0x882073F: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F300: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11EB7: ???
==32174==    by 0x88208F9: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F387: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11F0F: ???
==32174==    by 0x8820AB3: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F40E: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11F67: ???
==32174==    by 0x8820C6D: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F494: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11FBF: ???
==32174==    by 0x8820E27: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F518: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B12017: ???
==32174==    by 0x8820FE1: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F59C: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B1206F: ???
==32174==    by 0x882119B: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F620: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B120C7: ???
==32174==    by 0x8821355: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EDB2: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EDA5: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B47: ???
==32174==    by 0x881F656: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EE25: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B9F: ???
==32174==    by 0x881F8E9: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EEA5: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11BF7: ???
==32174==    by 0x881FAA5: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EF2A: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11C4F: ???
==32174==    by 0x881FC61: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EFB1: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CA7: ???
==32174==    by 0x881FE1D: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F031: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CFF: ???
==32174==    by 0x881FFD9: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F0B2: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11D57: ???
==32174==    by 0x8820195: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F12D: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11DAF: ???
==32174==    by 0x8820351: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F1A8: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11E07: ???
==32174==    by 0x882050D: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F223: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11E5F: ???
==32174==    by 0x88206C9: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F29E: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11EB7: ???
==32174==    by 0x8820885: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F319: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11F0F: ???
==32174==    by 0x8820A41: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F394: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11F67: ???
==32174==    by 0x8820BFD: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881F410: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11FBF: ???
==32174==    by 0x8820DB9: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F48F: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B12017: ???
==32174==    by 0x8820F75: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F50F: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B1206F: ???
==32174==    by 0x8821131: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F58F: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x6BA3327: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B120C7: ???
==32174==    by 0x88212ED: ???
==32174==    by 0x6B97C6F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EDA5: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EDA4: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B47: ???
==32174==    by 0x881F438: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EE28: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B9F: ???
==32174==    by 0x881F6D1: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EEAC: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11BF7: ???
==32174==    by 0x881F899: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EF30: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11C4F: ???
==32174==    by 0x881FA61: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EFB4: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CA7: ???
==32174==    by 0x881FC29: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F03B: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11CFF: ???
==32174==    by 0x881FDF1: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F0C6: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11D57: ???
==32174==    by 0x881FFB9: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F14A: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11DAF: ???
==32174==    by 0x8820181: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F1D2: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11E07: ???
==32174==    by 0x8820349: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F256: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11E5F: ???
==32174==    by 0x8820511: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F2DE: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11EB7: ???
==32174==    by 0x88206D9: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881F366: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x6B9F9E7: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11F0F: ???
==32174==    by 0x88208A1: ???
==32174==    by 0x6B9432F: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 8
==32174==    at 0x881EDA4: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EDB0: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x6B9AA5F: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B47: ???
==32174==    by 0x881F02B: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EE40: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x6B9AA5F: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11B9F: ???
==32174==    by 0x881F2BD: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EED0: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x6B9AA5F: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11BF7: ???
==32174==    by 0x881F477: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EF60: ???
==32174==    by 0x1FFEFFE2BF: ???
==32174==    by 0x33465E: AnalyzeShortFunctionDefinition(ExpressionContext&, SynShortFunctionDefinition*, TypeBase*, ArrayView<ArgumentData>, IntrusiveList<MatchData>) (ExpressionTree.cpp:9504)
==32174==    by 0x6EFD319: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x6B9AA5F: ???
==32174==    by 0x6A0F28F: ???
==32174==    by 0x6B11C4F: ???
==32174==    by 0x881F631: ???
==32174==    by 0x6B7E677: ???
==32174==    by 0x1FFEFFE607: ???
==32174==    by 0x1FFEFFE52F: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881EDB0: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 4
==32174==    at 0x881ED7B: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid read of size 4
==32174==    at 0x881ED78: ???
==32174==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32174== 
==32174== Invalid write of size 4
==32174==    at 0x881ED7C: ???
==32174==  Address 0x100 is not stack'd, malloc'd or (recently) free'd
==32174== 
Eval test finished in 560.860000
Eval test finished in 1212.312000
Expr Evaluated 4497 of 4497 tests
Inst Evaluated 4532 of 4532 tests
X86 passed 1652 of 1652 tests
RegVM passed 1649 of 1649 tests
Failure tests: passed 791 of 791 tests
Extra tests: passed 412 of 412 tests
Translation tests: passed 0 of 0 tests
Compilation time: 60433.061000
Get bytecode time: 3021.231000
Tree visit time: 917.626000
Expression evaluation time: 7118.310000
Instruction evaluation time: 7619.174000
Translation time: 18.518000
Clean time: 992.381000
Link time: 31381.618000
Run time: 30475.504000
Total time: 141977.423000
Total log output: 4616
Total nodes: 675826 syntax, 1416354 expression
Total RegVM instructions: 560080
Total optimizations: peephole        100238 const-prop    39404 dead-code-elim  313550 cflow-simp   77668
                   : load-store-prop 124948 subexpr-elim  16902 dead-store-elim  16696 func-inline      0
Total global allocs: 147149 (2337.375MB requested)
Passed 13533 of 13533 tests
==32174== 
==32174== HEAP SUMMARY:
==32174==     in use at exit: 0 bytes in 0 blocks
==32174==   total heap usage: 236,697 allocs, 236,697 frees, 3,789,363,603 bytes allocated
==32174== 
==32174== All heap blocks were freed -- no leaks are possible
==32174== 
==32174== For lists of detected and suppressed errors, rerun with: -s
==32174== ERROR SUMMARY: 74 errors from 72 contexts (suppressed: 0 from 0)
mingodad commented 1 year ago

It seems that there is an assert with side effects, because building in release mode but omitting -DNDEBUG and testing with valgrind there isn't any memory error.

mingodad commented 1 year ago

On NULLC/TypeTree.cpp there is lots of strlen(constant) inside loops, and in several places instead of strlen(constant) there is hard coded numbers.

mingodad commented 1 year ago

The problem seem to be here, when -DNDEBUG is defined, the assert macros doesn't seem to have any problem related to https://github.com/WheretIB/nullc/issues/35#issuecomment-1284204729 :

    bool    testHardFailureExecutor[TEST_TARGET_COUNT] = {
        true,
#if defined(NULLC_BUILD_X86_JIT) && defined(xxNDEBUG)
        true,
#else
        false,
#endif
        false
    };
mingodad commented 1 year ago

Hello @WheretIB ! Could you give some feedback on this issue(s) ? Cheers !

WheretIB commented 1 year ago

While testing this project on arm32 (android with termux clang9) I'm getting this errors: External function call. Class types sizeof() == 0, arguments in registers. sx [raw] External function call. Floating point register overflow mid argument. [raw] External function call. auto ref. { int; } returned. [raw] External function call. Small return type 1. [raw]

When running on armeabi-v7a Android device as well as on amr64-v8a, I do get some errors, but a bit different ones.

I/nullc: 303/ 303 External function call. double inside a class, argument in registers. [raw] [function] [REGVM] I/nullc: 314/ 315 External function call. Floating point register overflow mid argument. [raw] [function] [REGVM] I/nullc: 332/ 334 External function call. Big return type 2. [raw] [function] [REGVM]

Overall, I recommend using nullc with NULLC_NO_RAW_EXTERNAL_CALL define. But I'll see if I can better match the arm ABI for these complicated calls.

std.string test (raw character array operation) REGVM Execution failed: Assertion failed Call stack: global scope (line 38: at return runner();) runner (line 26: at assert(strcmp("zz", "test") > 1);)

Looks like you have an older version of nullc, current test is for assert(strcmp("zz", "test") == 1); and strcmp was fixed to only return -1, 0 and 1 in a recent update: https://github.com/WheretIB/nullc/pull/34

nullc compiler REGVM Execution failed: buffer is empty

Can't say why this one is failing, runs ok on my arm32 and arm64 Androids :(

And here is the output of make test on linux 32bits i686:

Once again, the string test looks outdated.

To check other failures, I'll need to setup an x86 linux emulator, I had one before and remember it working.

The null pointer access problem seem to be fixed adding missing casts:

Thank you, that's a recent regression. On Windows it can be recreated using #define ALLOC_TOP_DOWN in UnitTest.cpp. I'll have a fix a bit later.

The Conditional jump or move depends on uninitialised value seems to be due to this line

I'll add a clear there.

Here is the output of this project with my fixes on arm32 (adding this compiler option -fsigned-char):

Interesting, Android.mk already uses -fsigned-char on Android for ARM and this tests complete without errors, so I don't know what's different here.

This changes fix the loads are sign-extended error on arm:

This is probably a better solution than using -fsigned-char, thank, I'll use it later.

When building for 64bits on linux in release mode and executing bin/TestRun with valgrind we get this:

Don't see any overflows locally when running with -fsanitize=address in x64 linux. Added assertions in TypeTree functions as well to check that names respect bounds.

On NULLC/TypeTree.cpp there is lots of strlen(constant) inside loops

What's the problem?

and in several places instead of strlen(constant) there is hard coded numbers.

Formatting that adds numbers to a string reserves enough space for the largest number.

WheretIB commented 1 year ago

null pointer access error is fixed in https://github.com/WheretIB/nullc/pull/42

Your suggestion for signed/unsigned char fixes didn't work for me, I think additional fixes will be required. I suggest using -fsigned-char for now (with it more tests run correctly) and I'll work on fixing default unsigned char later.