You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to hijack a return from a function to commit results from it. However, there are problems when return from main is rerouted to a different routine, like in MILC:
Running simplifycfg works on MILC, turning the return from main into an unreachable, but not on all examples of the problem.
#include<cmath>
#include<cstdlib>
#include"ExtraPInstrumenter.hpp"// Reproduces a bug scenario where return from function is unreachable.// Running `simplify-cfg` pass is necessary to turn return into unreachable// code and putting loop commit calls correctly before the exit.voidexit_program()
{
exit(0);
}
intmain(int argc, char ** argv)
{
int x1 EXTRAP = atoi(argv[1]);
int x2 EXTRAP = 2*atoi(argv[2]);
register_variable(&x1, VARIABLE_NAME(x1));
register_variable(&x2, VARIABLE_NAME(x2));
int sum = 0;
for(int i = x1; i < x2; i++)
++sum;
exit_program();
return0;
}
The text was updated successfully, but these errors were encountered:
We need to hijack a return from a function to commit results from it. However, there are problems when return from main is rerouted to a different routine, like in MILC:
Running
simplifycfg
works on MILC, turning the return from main into an unreachable, but not on all examples of the problem.The text was updated successfully, but these errors were encountered: