[PATCH] D49946: Fix crash in bounds checking

Karl-Johan Karlsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 03:25:10 PDT 2018


Ka-Ka added a comment.

I found another reproducer for the problem. This one is slightly different where a different assert blow, but I guess its only a different symptom for the same fault. As this one is slightly smaller you might want to use this one as a testcase instead (or use both)? Run with "opt -bounds-checking -S".

@d = dso_local local_unnamed_addr global [1 x i16] zeroinitializer, align 1
@e = dso_local local_unnamed_addr global [1 x i16] zeroinitializer, align 1

define dso_local void @test2() local_unnamed_addr {
entry:

  br label %while.cond1.preheader

while.cond1.preheader:

  %0 = phi i16 [ undef, %entry ], [ %inc, %while.end ]
  %1 = load i16, i16* undef, align 1
  br label %while.end

while.end:

  %inc = add nsw i16 %0, 1
  %arrayidx = getelementptr inbounds [1 x i16], [1 x i16]* @e, i16 0, i16 %0
  %2 = load i16, i16* %arrayidx, align 1
  br i1 false, label %while.end6, label %while.cond1.preheader

while.end6:

  ret void

}


Repository:
  rL LLVM

https://reviews.llvm.org/D49946





More information about the llvm-commits mailing list