[LLVMdev] reading untrusted bitcode

Nick Lewycky nicholas at mxc.ca
Sat Jun 6 18:32:10 PDT 2009


Suppose I had a program that would receive bitcode and do something with 
it other than run it, and for performance I this program is built 
Release-Asserts.

Currently, illegal types are caught by the AsmParser and again by some 
assertions in Type.cpp. However, a .bc file could contain an illegal 
type like [5 x void] and without assertions enabled, this actually gets 
created in the IR. Also, the verifier doesn't check for these, assuming 
that illegal types must have come in through the C++ API.

Whose responsibility is it supposed to be to check types for legality? 
The BCReader? Or perhaps the verifier?

Nick




More information about the llvm-dev mailing list