|
|
|
|
|
by 0xdeafbeef
57 days ago
|
|
uintptr_t x = opaque((uintptr_t)p);
free((void *)x);
free(p); How will you find such violations if opaque comes from so or some ffi, so compiler can't see through?
you can't. It's heuristics. Sound type system is much stronger |
|
Christ. Even rust makes ffi unsafe.
I mean you can annotate it if you want. Just tell the analyzer in a separate file, get the variable at this line on this file has these guarantees.
You could even annotate dependencies that didn't use your static analyzer. You could track custom invariants that your language designer didn't put in the type system.