Commit 2f0ce4c
committed
IRGen: GenericContextScope always resets CurGenericSignature to old value
Previously, we didn't reset it if the old value was null, however this
enabled a very fragile anti-pattern:
// ... CurGenericSignature is not set here ...
{
GenericContextScope scope(IGM, newSig);
// signature is now newSig
...
}
// ... old signature is still newSig!
foo(IGM.getCurGenericContext()); // works, most of the time1 parent cda25b7 commit 2f0ce4c
2 files changed
+0
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1441 | 1441 | | |
1442 | 1442 | | |
1443 | 1443 | | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | 1444 | | |
1448 | 1445 | | |
1449 | 1446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
282 | 280 | | |
283 | 281 | | |
284 | 282 | | |
| |||
0 commit comments