diff options
author | Alon Zakai <azakai@google.com> | 2023-09-22 14:00:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-22 14:00:22 -0700 |
commit | 4f1295a96d175f39257a750e06a426e5beb3933a (patch) | |
tree | 67192d497029e3f87432bd094f967e48580675f9 /test/gtest/stringify.cpp | |
parent | a62ee0de8d0b1eccf8b5673b3ec9125cc44d3e3d (diff) | |
download | binaryen-4f1295a96d175f39257a750e06a426e5beb3933a.tar.gz binaryen-4f1295a96d175f39257a750e06a426e5beb3933a.tar.bz2 binaryen-4f1295a96d175f39257a750e06a426e5beb3933a.zip |
StackIR local2stack: Make sure we do not break non-nullable validation (#5919)
local2stack removes a pair of
local.set 0
local.get 0
when that set is not used anywhere else: whatever value is put into the local,
we can just leave it on the stack to replace the get. However, we only handled
actual uses of the set which we checked using LocalGraph. There may be code
that does not actually use the set local, but needs that set purely for validation
reasons:
local.set 0
local.get 0
block
local.set 0
end
local.get
That last get reads the value set in the block, so the first set is not used by it.
But for validation purposes, the inner set stops helping at the block end, so
we do need that initial set.
To fix this, check for gets that need our set to validate before removing any.
Fixes #5917
Diffstat (limited to 'test/gtest/stringify.cpp')
0 files changed, 0 insertions, 0 deletions