projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
12024f8
)
[analyzer] Add a test for PR13927 "offsetof replacement flagged as null deref"
author
Jordan Rose
<jordan_rose@apple.com>
Mon, 1 Oct 2012 19:07:19 +0000
(19:07 +0000)
committer
Jordan Rose
<jordan_rose@apple.com>
Mon, 1 Oct 2012 19:07:19 +0000
(19:07 +0000)
This seems to be legal according to C11 6.5.3.2.
No functionality change.
llvm-svn: 164959
clang/test/Analysis/array-struct.c
patch
|
blob
|
history
diff --git
a/clang/test/Analysis/array-struct.c
b/clang/test/Analysis/array-struct.c
index
223069f
..
c22f979
100644
(file)
--- a/
clang/test/Analysis/array-struct.c
+++ b/
clang/test/Analysis/array-struct.c
@@
-175,3
+175,11
@@
void f18() {
if (*q) { // no-warning
}
}
+
+
+// [PR13927] offsetof replacement macro flagged as "dereference of a null pointer"
+int offset_of_data_array(void)
+{
+ return ((char *)&(((struct s*)0)->data_array)) - ((char *)0); // no-warning
+}
+