KhronosGroup/SPIRV-LLVM

Garbage passed as an argument to llvm::Value::setName

Closed this issue · 2 comments

LIT test fails on RH6.5 on assertion in llvm::Value::setName (on debug build).

To reproduce:
llvm-lit -v path-to-llvm/test/SPIRV/image-unoptimized.ll
image-unoptimized.bt.txt

pull request #25 fixes this.

The issue was due to saving StringRef of CallInst->getName() for later use. However StringRef is not safe to cache since the pointee may be freed or overwritten.