Silly bug: don't pass NULL to the print() stmt when we want a llvm::Value * that has the value NULL.
(This was causing crashes with print() statements with no additional values to be printed.)
This commit is contained in:
7
stmt.cpp
7
stmt.cpp
@@ -1464,8 +1464,11 @@ PrintStmt::EmitCode(FunctionEmitContext *ctx) const {
|
||||
llvm::Value *args[5];
|
||||
std::string argTypes;
|
||||
|
||||
if (values == NULL)
|
||||
args[4] = NULL;
|
||||
if (values == NULL) {
|
||||
LLVM_TYPE_CONST llvm::Type *ptrPtrType =
|
||||
llvm::PointerType::get(LLVMTypes::VoidPointerType, 0);
|
||||
args[4] = llvm::Constant::getNullValue(ptrPtrType);
|
||||
}
|
||||
else {
|
||||
// Get the values passed to the print() statement evaluated and
|
||||
// stored in memory so that we set up the array of pointers to them
|
||||
|
||||
Reference in New Issue
Block a user