Issue 91380
Summary AllocaInst::getAllocationSize/AllocaInst::getAllocationSizeInBits should check for overflow
Labels good first issue
Assignees
Reporter efriedma-quic
    Currently, the code just blindly multiplies the size, and can therefore return a nonsense result.  (The behavior isn't really defined in the overflow case, but reasoning based on the overflowed computation is likely to lead to weird results.)

https://github.com/llvm/llvm-project/blob/7115ed0fff027b65fa76fdfae215ed1382ed1473/llvm/lib/Transforms/Utils/InlineFunction.cpp#L2622 has code to compute the allocation size while conservatively checking for overflow; we should use similar logic, then make the inliner call getAllocationSize().  Maybe use the multiply-with-overflow helper from CheckedArithmetic.h instead of writing out that code.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to