zetzit / zz

πŸΊπŸ™ ZetZ a zymbolic verifier and tranzpiler to bare metal C
MIT License
1.6k stars 52 forks source link

BREAKING new constructor now uses uninitialized memory #128

Closed aep closed 3 years ago

aep commented 3 years ago

constructor functions are required to use the "new" tag on a pointer, which also allows uniitialized memorey to be passed (not checked yet)

so far new calls have initialized memory anyway, to prevent some subtle bugs, but this actually has a big performance hit for large tail memory.

this change will remove to 0 initialization, so any function accepting a new pointer has to properly initialize it. std has always done this, but there may be bugs in user code.

the default zz build mode (test) enables ubsan which catches these errors at runtime, so they should be quick to find.