[DataLayout] Check StackNatural and FunctionPtr alignments.

MaybeAlignment asserts that the passed in value is == 0 or a power of 2.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16272

Reviewers: michaelplatings, gchatelet, jakehehrlich, jfb

Reviewed By: gchatelet

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65858

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368191 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Florian Hahn
2019-08-07 17:20:55 +00:00
parent 948e657594
commit 2e0aa49547
5 changed files with 23 additions and 2 deletions
@@ -0,0 +1,5 @@
; Bitcode with invalid function pointer alignment.
; RUN: not llvm-dis %s.bc -o - 2>&1 | FileCheck %s
CHECK: LLVM ERROR: Alignment is neither 0 nor a power of 2