-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
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
LLVM assertion: "Initializer type must match GlobalVariable type" #1406
Comments
@shuangxiangkan could you take a look at this case? |
@251 Could you upload the bc file? |
Sure: test.zip. But keep in mind that assertions in LLVM have to be enabled, for distribution packages this is typically not the case. |
I ran into the same problem today. I managed to fix it by reverting this change, i.e., I replaced glob->setInitializer(newCA); by auto globName = glob->getName();
glob->setName("llvm.global.annotations_old");
GlobalVariable *newGlob = new GlobalVariable(*module, annotationsType, glob->isConstant(), glob->getLinkage(), newCA, globName, glob, glob->getThreadLocalMode());
newGlob->setSection(glob->getSection());
newGlob->setAlignment(glob->getAlign());
glob->replaceAllUsesWith(newGlob);
glob->eraseFromParent(); in svf-llvm/lib/LLVMUtil.cpp. |
@251 @JanWichelmann This issue should have been fixed in #1420. |
Works for me, thank you! |
Hi,
I updated to LLVM 15 (with assertions enabled) and whatever I run ends up in an assertion, e.g.:
I attached gdb and the issue seems to be that:
https://github.com/SVF-tools/SVF/blob/fa0d081299fd2ace031469a630f00904ba1ee42f/svf-llvm/lib/LLVMUtil.cpp#L511C1-L511C33
causes a type mismatch:
newCA
(InitVal
in LLVM) has type[0 x { ptr, ptr, ptr, i32, ptr }] zeroinitializer
whereasglob
has the type[217 x { ptr, ptr, ptr, i32, ptr }]
(the annotation array).The text was updated successfully, but these errors were encountered: