Closed JonathanFoo0523 closed 1 month ago
Avoiding mutation inside __builtin_frame_address()
is not sufficient. Here's another example:
void foo() {
const int x = 0;
__builtin_frame_address(x);
}
compiles.
But the following doesn't:
void foo() {
const int x = __dredd_replace_expr_int_zero(0, 0);
if (!__dredd_enabled_mutation(4)) { __builtin_frame_address(x); }
}
with the same compilation error as previous.
We probably need some kind of rewriting as done by #273
@JonathanFoo0523 Feel free to have a go at fixing this via rewriting, as per #273 - though please see #287 first, which changes the approach of #273 a bit. If you can review #287 then we can get it merged.
It seems that not all __builtin_func()
calls require the argument to be a constant integer. However, we don't have an easy way to check if a function argument must be a constant integer (at least to my knowledge).
@afd, is it okay to specifically check for the __builtin_frame_address()
function call and replace its argument expression? We might encounter other __builtin_func()
calls that require a constant integer in the future.
Yes, please check specifically for __builtin_frame_address()
for now, and we can add other builtin functions that turn out to require constant arguments as and when we find them.
Dredd mutates the
__builtin_frame_address()
into
leading to compilation error: