summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-03-13 18:00:48 -0700
committerGitHub <noreply@github.com>2024-03-13 18:00:48 -0700
commit6e8fefe1ea13346f8908075d1f35b23317cfcc0f (patch)
treedf2f723a8dae648525f2208bcc61cfc2727d0865 /src
parent3edc08c80a135b69d20235cbb620c48109d7b866 (diff)
downloadbinaryen-6e8fefe1ea13346f8908075d1f35b23317cfcc0f.tar.gz
binaryen-6e8fefe1ea13346f8908075d1f35b23317cfcc0f.tar.bz2
binaryen-6e8fefe1ea13346f8908075d1f35b23317cfcc0f.zip
Fix a build error when assertions are disabled (#6397)
Add `[[maybe_unused]]` to variables that are only used in assertions. In builds without assertions enabled, these were causing compiler errors about unused variables.
Diffstat (limited to 'src')
-rw-r--r--src/tools/fuzzing/fuzzing.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp
index 9a44119f5..ed9eb15e2 100644
--- a/src/tools/fuzzing/fuzzing.cpp
+++ b/src/tools/fuzzing/fuzzing.cpp
@@ -464,7 +464,8 @@ void TranslateToFuzzReader::finalizeMemory() {
// unless GC is enabled. This can occur due to us adding a local
// definition to what used to be an imported global in initial contents.
// To fix that, replace such invalid offsets with a constant.
- for (auto* get : FindAll<GlobalGet>(segment->offset).list) {
+ for ([[maybe_unused]] auto* get :
+ FindAll<GlobalGet>(segment->offset).list) {
// No imported globals should remain.
assert(!wasm.getGlobal(get->name)->imported());
// TODO: It would be better to avoid segment overlap so that
@@ -508,7 +509,8 @@ void TranslateToFuzzReader::finalizeTable() {
// no longer is (not ok unless GC is enabled), we may need to change
// that.
if (!wasm.features.hasGC()) {
- for (auto* get : FindAll<GlobalGet>(segment->offset).list) {
+ for ([[maybe_unused]] auto* get :
+ FindAll<GlobalGet>(segment->offset).list) {
// No imported globals should remain.
assert(!wasm.getGlobal(get->name)->imported());
// TODO: the segments must not overlap...