Commit dfea163
committed
[Demangler] Fix assertion failure.
It's illegal to call `node->addChild()` with a `NULL` child argument;
it's possible to construct unexpected `Node` trees by passing invalid
manglings, and in this case that was causing `popTypeAndGetChild()` to
fail (because the top node was not a `Type` node), which then meant
that the call to `addChild` had a `NULL` child argument.
The simplest fix is to use `createWithChildren()` to do the node
construction, because that function checks its arguments for `NULL`s.
rdar://1253502191 parent a63078f commit dfea163
File tree
2 files changed
+6
-3
lines changed- lib/Demangling
- test/Demangle/Inputs
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3134 | 3134 | | |
3135 | 3135 | | |
3136 | 3136 | | |
3137 | | - | |
3138 | | - | |
3139 | | - | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
3140 | 3140 | | |
3141 | 3141 | | |
3142 | 3142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments