Commit 63b499e
authored
In AsmConstWalker, don't assume a segment exists (WebAssembly#697)
It's possible to generate an EM_ASM call with empty contents (due to
ifdefs, for example), and this gets converted to an empty string.
AsmConstWalker assumes that by this point any addresses it is pointing
to have a corresponding data section, which is reasonable. However in
the case of an empty string, we don't create a data section, but just
leave that address uninitialized, i.e. set to 0.
In the case of AsmConstWalker, a correct thing to do is to emit the
empty string as metadata, which becomes an empty emscripten_asm_v call.1 parent ac078dc commit 63b499e
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
| |||
0 commit comments