2017-03-04 02:02:02 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core -analyzer-config path-diagnostics-alternate=true -analyzer-output=plist-multi-file -o %t.plist -verify %s
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// RUN: FileCheck --input-file=%t.plist %s
|
|
|
|
|
|
|
|
extern void work();
|
|
|
|
|
|
|
|
void testLoop() {
|
|
|
|
int z[] = {1,2};
|
|
|
|
for (int y : z) {
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
if (y == 2)
|
|
|
|
*(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
(void)y;
|
|
|
|
}
|
|
|
|
|
|
|
|
*(volatile int *)0 = 1; // no-warning
|
|
|
|
}
|
|
|
|
|
|
|
|
class MagicVector {
|
|
|
|
public:
|
|
|
|
MagicVector();
|
|
|
|
|
|
|
|
using iterator = int *;
|
|
|
|
|
|
|
|
iterator begin() const;
|
|
|
|
iterator end() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
MagicVector get(bool fail = false) {
|
|
|
|
if (fail)
|
|
|
|
*(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
|
|
|
|
return MagicVector{};
|
|
|
|
}
|
|
|
|
|
|
|
|
void testLoopOpaqueCollection() {
|
|
|
|
for (int y : get()) {
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
if (y == 2)
|
|
|
|
*(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
(void)y;
|
|
|
|
}
|
|
|
|
|
|
|
|
*(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class MagicVector2 {
|
|
|
|
public:
|
|
|
|
MagicVector2();
|
|
|
|
|
|
|
|
class iterator {
|
|
|
|
public:
|
|
|
|
int operator*() const;
|
|
|
|
iterator &operator++();
|
|
|
|
bool operator==(const iterator &);
|
|
|
|
bool operator!=(const iterator &);
|
|
|
|
};
|
|
|
|
|
|
|
|
iterator begin() const;
|
|
|
|
iterator end() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
MagicVector2 get2() {
|
|
|
|
return MagicVector2{};
|
|
|
|
}
|
|
|
|
|
|
|
|
void testLoopOpaqueIterator() {
|
|
|
|
for (int y : get2()) {
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
if (y == 2)
|
|
|
|
*(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
(void)y;
|
|
|
|
}
|
|
|
|
|
|
|
|
*(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void testLoopErrorInRange() {
|
|
|
|
for (int y : get(true)) { // error inside get()
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
if (y == 2)
|
|
|
|
*(volatile int *)0 = 1; // no-warning
|
|
|
|
work();
|
|
|
|
work();
|
|
|
|
(void)y;
|
|
|
|
}
|
|
|
|
|
|
|
|
*(volatile int *)0 = 1; // no-warning
|
|
|
|
}
|
|
|
|
// CHECK: <key>diagnostics</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>path</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>13</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>13</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>13</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>13</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>15</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>15</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>15</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>15</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Looping back to the head of the loop</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Looping back to the head of the loop</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>28</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>category</key><string>Logic error</string>
|
|
|
|
// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
|
2015-02-10 06:52:26 +08:00
|
|
|
// CHECK-NEXT: <key>check_name</key><string>core.NullDereference</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <!-- This hash is experimental and going to change! -->
|
|
|
|
// CHECK-NEXT: <key>issue_hash_content_of_line_in_context</key><string>7c0b35987817cf3d44b88c5349bcd4f2</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
|
|
|
|
// CHECK-NEXT: <key>issue_context</key><string>testLoop</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <key>issue_hash_function_offset</key><string>6</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>12</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>path</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>18</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>16</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>88</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Calling 'get'</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Calling 'get'</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>31</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>1</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>1</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Entered call from 'testLoopErrorInRange'</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Entered call from 'testLoopErrorInRange'</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>31</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>1</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>31</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>11</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>32</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>32</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>4</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>32</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>32</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>4</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>1</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>category</key><string>Logic error</string>
|
|
|
|
// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
|
2015-02-10 06:52:26 +08:00
|
|
|
// CHECK-NEXT: <key>check_name</key><string>core.NullDereference</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <!-- This hash is experimental and going to change! -->
|
|
|
|
// CHECK-NEXT: <key>issue_hash_content_of_line_in_context</key><string>f53792d63dffe6176babc00ee455a3e0</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
|
|
|
|
// CHECK-NEXT: <key>issue_context</key><string>get</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <key>issue_hash_function_offset</key><string>2</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>33</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>path</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>39</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>39</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>39</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>39</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Assuming 'y' is equal to 2</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Assuming 'y' is equal to 2</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>41</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>28</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>category</key><string>Logic error</string>
|
|
|
|
// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
|
2015-02-10 06:52:26 +08:00
|
|
|
// CHECK-NEXT: <key>check_name</key><string>core.NullDereference</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <!-- This hash is experimental and going to change! -->
|
|
|
|
// CHECK-NEXT: <key>issue_hash_content_of_line_in_context</key><string>7bc3cb8a56be029296ec61f7ee83fc9e</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
|
|
|
|
// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueCollection</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <key>issue_hash_function_offset</key><string>5</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>42</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>path</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
2013-11-08 09:15:30 +08:00
|
|
|
// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>message</key>
|
2013-11-08 09:15:30 +08:00
|
|
|
// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>38</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>category</key><string>Logic error</string>
|
|
|
|
// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
|
2015-02-10 06:52:26 +08:00
|
|
|
// CHECK-NEXT: <key>check_name</key><string>core.NullDereference</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <!-- This hash is experimental and going to change! -->
|
|
|
|
// CHECK-NEXT: <key>issue_hash_content_of_line_in_context</key><string>dc7b457a64bd56c30467c1af44049756</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
|
|
|
|
// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueCollection</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <key>issue_hash_function_offset</key><string>11</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>48</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>path</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Entering loop body</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>74</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>74</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>74</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>74</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>8</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>6</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Assuming 'y' is equal to 2</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Assuming 'y' is equal to 2</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>76</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>9</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>7</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>28</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>category</key><string>Logic error</string>
|
|
|
|
// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
|
2015-02-10 06:52:26 +08:00
|
|
|
// CHECK-NEXT: <key>check_name</key><string>core.NullDereference</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <!-- This hash is experimental and going to change! -->
|
|
|
|
// CHECK-NEXT: <key>issue_hash_content_of_line_in_context</key><string>f4697ded3a92318349a3969238e05387</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
|
|
|
|
// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueIterator</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <key>issue_hash_function_offset</key><string>5</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>77</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>26</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>path</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>14</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
2013-11-08 09:15:30 +08:00
|
|
|
// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>message</key>
|
2013-11-08 09:15:30 +08:00
|
|
|
// CHECK-NEXT: <string>Loop body skipped when range is empty</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>73</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>5</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>control</string>
|
|
|
|
// CHECK-NEXT: <key>edges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>start</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>end</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>kind</key><string>event</string>
|
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <key>ranges</key>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <array>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>3</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>24</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>depth</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: <key>extended_message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>message</key>
|
|
|
|
// CHECK-NEXT: <string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|
|
|
|
// CHECK-NEXT: <key>description</key><string>Dereference of null pointer</string>
|
|
|
|
// CHECK-NEXT: <key>category</key><string>Logic error</string>
|
|
|
|
// CHECK-NEXT: <key>type</key><string>Dereference of null pointer</string>
|
2015-02-10 06:52:26 +08:00
|
|
|
// CHECK-NEXT: <key>check_name</key><string>core.NullDereference</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <!-- This hash is experimental and going to change! -->
|
|
|
|
// CHECK-NEXT: <key>issue_hash_content_of_line_in_context</key><string>6855b29ad2407a5af43c57f062bc4602</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>issue_context_kind</key><string>function</string>
|
|
|
|
// CHECK-NEXT: <key>issue_context</key><string>testLoopOpaqueIterator</string>
|
2015-10-22 19:53:04 +08:00
|
|
|
// CHECK-NEXT: <key>issue_hash_function_offset</key><string>11</string>
|
[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.
In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.
One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.
<rdar://problem/14038483>
llvm-svn: 183449
2013-06-07 05:53:45 +08:00
|
|
|
// CHECK-NEXT: <key>location</key>
|
|
|
|
// CHECK-NEXT: <dict>
|
|
|
|
// CHECK-NEXT: <key>line</key><integer>83</integer>
|
|
|
|
// CHECK-NEXT: <key>col</key><integer>22</integer>
|
|
|
|
// CHECK-NEXT: <key>file</key><integer>0</integer>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </dict>
|
|
|
|
// CHECK-NEXT: </array>
|