We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当入口块(insert)的后继块不等于origBB的第一个元素时,会导致控制流出错,demo:
extern "C" __attribute((__annotate__(("fla")))) void func(){ //人类不太会这样写,但是一些生成代码比方说unity的il2cpp时会出现这样的代码 printf("block1\n"); int a = 0; goto label2; label: printf("block2\n"); a = 1; label2: { printf("block3\n"); if(a % 2 == 0){ goto label; } } label3: { printf("block4\n"); printf("%d\n",a); return; } }
可以在预处理第一个块的时候只要有后继就split,这样就保证了origBB的第一个元素一定是入口块的后继: 原代码
// Flattening.cpp : bool Flattening::flatten(Function *f) if ((br != NULL && br->isConditional()) || insert->getTerminator()->getNumSuccessors() > 1) { ...
修复代码:
// Flattening.cpp : bool Flattening::flatten(Function *f) if ((br != NULL && br->isConditional()) || insert->getTerminator()->getNumSuccessors() >= 1) { ....
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当入口块(insert)的后继块不等于origBB的第一个元素时,会导致控制流出错,demo:
可以在预处理第一个块的时候只要有后继就split,这样就保证了origBB的第一个元素一定是入口块的后继:
原代码
修复代码:
The text was updated successfully, but these errors were encountered: