Hi All,
I debug a Release build LLVM crash, and find the culprit. The code snippet below,
llvm::ArrayRef Ops = { Lo, Hi }; // should be SDValue Ops[2] = { Lo, Hi };
return DAG.getMergeValues(Ops, dl);
Turns out a nullptr is dereferenced in DAG.getMergeValues, thus I have segfault.
From the comment on [1], it says:
This class does not own the underlying data, it is expected to be used in situations
where the data resides in some other buffer, whose lifetime extends past that of the
ArrayRef. For this reason, it is not in general safe to store an ArrayRef.
I feel somehow the comment explain why I get the segfault, but not sure about that.
Would someone kindly explain why?
Thanks.
[1] http://llvm.org/doxygen/classllvm_1_1ArrayRef.html
Regards,
chenwj