mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 19:49:36 +00:00
88fccbdea7
Basically the same issue as string init, except it didn't really have any visible consequences before I removed the implicit lvalue-to-rvalue conversion from CodeGen. While I'm here, a couple minor drive-by cleanups: IgnoreParens never returns a ConstantExpr, and there was a potential crash with string init involving a ChooseExpr. The analyzer test change maybe indicates we could simplify the analyzer code a little with this fix? Apparently a hack was added to support lvalues in initializers in r315750, but I'm not really familiar with the relevant code. Fixes regression reported in the kernel build at https://bugs.llvm.org/show_bug.cgi?id=40430#c6 . Differential Revision: https://reviews.llvm.org/D58069 llvm-svn: 353762
9 lines
329 B
C
9 lines
329 B
C
// RUN: %clang_cc1 -triple=i386-apple-darwin10 -analyze -analyzer-checker=debug.ExprInspection -verify %s
|
|
void clang_analyzer_eval(int);
|
|
|
|
// pr28449: Used to crash.
|
|
void foo(void) {
|
|
static const unsigned short array[] = (const unsigned short[]){0x0F00};
|
|
clang_analyzer_eval(array[0] == 0x0F00); // expected-warning{{TRUE}}
|
|
}
|