-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Assert valid target data string in LLVMCreateTargetData #9370
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
Comments
(checked with Function explicit DataLayout(StringRef LayoutDescription) {
reset(LayoutDescription);
}
llvm-project/llvm/lib/IR/DataLayout.cpp Lines 195 to 221 in 6009708
As there are validation checks in place as requested, I think this ticket can be closed. |
Extended Description
Please add an assert to LLVMCreateTargetData (i.e. the C++ function that it calls), that checks whether the input string is correct. It seems that there is no way to find out, if an input string is actually valid. If I pass "nonsense" I get a non-NULL pointer as result (that is, the TargetDataRef does not show me, that the input was wrong), and if I pass that to LLVMAddTargetData then things go silently wrong in a very awful way.
See ticket #6394 for an example.
http://llvm.org/bugs/show_bug.cgi?id=6394
The text was updated successfully, but these errors were encountered: