Commit 8175a71
GNU3 demangler: fix substitution table for unscoped template names and sr intermediate qualifiers
Two missing substitution table entries caused out-of-range access (SG_=17)
when decoding symbols like std::swap<T> with enable_if/enable_if constraints:
1. DemangleName case 'S': after processing template args for an unscoped name
(e.g. St 4swap I...E), the encoder pushes BOTH the prefix (std::swap) AND
the full instantiation (std::swap<T>) to the substitution table. We were
only pushing the prefix. Fixed by adding PushType(type) after template
args are appended.
2. DemangleExpression sr else branch: when processing a multi-level sr scope
without the N prefix (e.g. sr St 6__and_ I...E ...), intermediate template
qualifiers must be pushed to the substitution table. Previously the while
loop appended to 'out' but never called PushType, unlike the N-prefix branch.
Fixed by adding PushType(CreateUnknownType(...)) for intermediate qualifiers.
Reduces failures from 211 to 90 on the 178,883-symbol test corpus (99.95%).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b381baf commit 8175a71
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1859 | 1859 | | |
1860 | 1860 | | |
1861 | 1861 | | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
1862 | 1865 | | |
1863 | 1866 | | |
1864 | 1867 | | |
| |||
2243 | 2246 | | |
2244 | 2247 | | |
2245 | 2248 | | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
2246 | 2254 | | |
2247 | 2255 | | |
2248 | 2256 | | |
| |||
0 commit comments