A seg-fault occurs due to a reference of a null pointer, which is the value returned by getConstantPart. This function returns null if the constant part is not found. The code that calls this function needs to check for the null return value.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Hi Brendan,
I'm not familiar with this code, but this change looks innocent enough that I LGTM'ed it.
However, I have a design nit: it looks like getConstantPart should be defined to take a const SCEV * and if it is a SCEVConstant, return that, else if it is SCEVMulExpr do what it does today and otherwise return nullptr -- it looks like that will fit in better with how getConstantPart is used. Moreover, a SCEVConstantExpr is really a degenerate SCEVMulExpr :) Do you mind doing that refactoring in a later change?
Comment Actions
Thanks for the review, Sanjoy. I'll refactor the getConstantPart function in a subsequent change as suggested.