[cfe-dev] Possible error in EmitCXXNewAllocSize

Daniel Schwartz-Narbonne dstwo at princeton.edu
Sat Apr 9 11:25:39 PDT 2011


I was looking through the code for this function, and on line 533,
where you check whether an overflow occurred, you say
      DidOverflow = CGF.Builder.CreateAnd(DidOverflow, AddDidOverflow);
Shouldn't this be an OR?  Doesn't the error occur if either the
multiplication or the addition overflowed?

Daniel



More information about the cfe-dev mailing list