diff --git a/llvm/lib/CheerpWriter/CheerpWriter.cpp b/llvm/lib/CheerpWriter/CheerpWriter.cpp index 9b9e2e5a785d..37a99cb49ce7 100644 --- a/llvm/lib/CheerpWriter/CheerpWriter.cpp +++ b/llvm/lib/CheerpWriter/CheerpWriter.cpp @@ -4994,7 +4994,7 @@ CheerpWriter::COMPILE_INSTRUCTION_FEEDBACK CheerpWriter::compileCallInstruction( // afterwards bool asmjsCallee = calledFunc && calledFunc->getSection() == StringRef("asmjs"); uint32_t addrShift = 0; - if (!asmjs && asmjsCallee && kind == Registerize::OBJECT && PA.getPointerKindAssert(&ci) == SPLIT_REGULAR && !ci.use_empty()) + if (!asmjs && asmjsCallee && kind == Registerize::OBJECT && retTy->isPointerTy() && PA.getPointerKindAssert(&ci) == SPLIT_REGULAR && !ci.use_empty()) { addrShift = compileHeapForType(cast(ci.getType())->getPointerElementType()); stream << ';' << NewLine;