From cc8c673e61c05dcfd4aaf34f0d1a1454991bc795 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 31 Oct 2013 04:20:23 +0000 Subject: Fix a use after free on invalid input. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193737 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Bitcode/invalid.ll | 7 +++++++ test/Bitcode/invalid.ll.bc | Bin 0 -> 332 bytes 2 files changed, 7 insertions(+) create mode 100644 test/Bitcode/invalid.ll create mode 100644 test/Bitcode/invalid.ll.bc (limited to 'test/Bitcode') diff --git a/test/Bitcode/invalid.ll b/test/Bitcode/invalid.ll new file mode 100644 index 0000000000..49189bf8c0 --- /dev/null +++ b/test/Bitcode/invalid.ll @@ -0,0 +1,7 @@ +; RUN: not llvm-dis < %s.bc 2>&1 | FileCheck %s + +; CHECK: llvm-dis: Unknown attribute kind + +; invalid.ll.bc has an invalid attribute number. +; The test checks that LLVM reports the error and doesn't access freed memory +; in doing so. diff --git a/test/Bitcode/invalid.ll.bc b/test/Bitcode/invalid.ll.bc new file mode 100644 index 0000000000..b8b1c47b6a Binary files /dev/null and b/test/Bitcode/invalid.ll.bc differ -- cgit v1.2.3