[PATCH] Fix infinite recursion in MemoryBuiltins when examining cyclic instruction

Stephen Lin swlin at post.harvard.edu
Wed Oct 9 10:22:24 PDT 2013


Apologies, it seems like this is already fixed ToT (was working off an old
checkout without realizing it).
Sorry for the noise.
-Stephen


On Wed, Oct 9, 2013 at 10:06 AM, Stephen Lin <swlin at post.harvard.edu> wrote:

> Hi,
>
> This patch is to resolve a crash (stack overflow) bug that was narrowed
> down to infinitely recursive calls to
> ObjectSizeOffsetEvaluator::visitGEPOperator and
> ObjectSizeOffsetEvaluator::compute_ when visiting an unreachable but cyclic
> instruction to the effect of:
>
>     %cyclic = getelementptr inbounds i8* %cyclic, i64 0
>
> I originally thought the issue was that the cycle was being formed at all,
> but apparently cycle formation in unreachable code is something which is
> known to be possible after certain transformations (this particular cycle
> happens after PHI node simplification in an unreachable basic block
> leftover from some other pass). ObjectSizeOffsetVisitor in same file has a
> comment that the possibility of cycles is expected and bails out when
> detecting, so I just modified the ObjectSizeOffsetEvaluator to do the same
> thing.
>
> This change is very small but I'm not very familiar with this particular
> code, so if anyone with more expertise with it can take a look, please let
> me know.
>
> Thanks,
> Stephen
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131009/8bc1a74b/attachment.html>


More information about the llvm-commits mailing list