search for: objectsizemin

Displaying 2 results from an estimated 2 matches for "objectsizemin".

2017 Jan 02
2
RFC: Allowing @llvm.objectsize to be more conservative with null.
...null (GCC gives back 2 for > __builtin_object_size(malloc(2), 0)). In other words, this `null-is-unknown` > bit only makes the objectsize evaluator see `T* null` as though it was `call > T* @opaque_user_defined_function()`, nothing else. I meant to say that it looks like the semantics of ObjectSizeMin(X) is that "return the conservative minimum object size for all values that X may take at runtime" (resp. ObjectSizeMax(X)). For instance this: void i(int c, volatile int* sink) { void* mem1 = malloc(20); void* mem2 = malloc(40); *sink = __builtin_object_size(c ? mem1 : mem2, 0);...
2017 Jan 02
2
RFC: Allowing @llvm.objectsize to be more conservative with null.
Hi George, Have you considered changing our existing behavior to match GCC's builtin_object_size instead of adding a new parameter? That may be simpler overall. There's also a clear upgrade strategy -- fold every old style call to "<min> ? 0 : 1". You probably already know this, but GCC folds builtin_object_size(0, 0) to -1 and builtin_object_size(0, 2) to 0. We'll