diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-04-25 11:58:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-25 11:58:06 -0700 |
| commit | b54629fe3fc48b42ae7f6c4f4594f85d5934c577 (patch) | |
| tree | 44781f1fbf7a513fbdde028f9f06f8d916c0d652 /source/slang/vm.cpp | |
| parent | 9a7849d893ebb755a607befff6b3429830421112 (diff) | |
Fix for global generic parameter substitution (#512)
The problem here arises when multiple entry points are compiled in one pass. Each entry point has its own arguments for global generic parameters, and leads to us emitting a `bindGlobalGenericParameter(p, val)`. But once the first entry point's substitutions are applied, the second entry point's code gives `bindGlobalGenericParameter(val, val)` and the compiler crashes (in debug builds) because `val` is not a global generic parameter.
This change just applies a quick fix. If we see `bindGlobalGenericParameter(x,y)` during specialization, and `x` is not a global generic parameter, then we skip it.
The right long-term fix is to change the compiler's representation of global generic arguments so that they live on a `CompileRequest` instead of an `EntryPointRequest`. That is a more significant change (with impact on the public API), so I'm inclined to leave it as a cleanup for another day (given that no customers are using global generic parameters today).
Diffstat (limited to 'source/slang/vm.cpp')
0 files changed, 0 insertions, 0 deletions
