aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-07 16:19:27 +0000
committergingerBill <bill@gingerbill.org>2021-11-07 16:19:27 +0000
commitdc2edd3e7904d76bd6e4e4eb02e27a1f3cb4b305 (patch)
tree4ad3bff8503be9ae9a257a506dc205932c07cab4 /src/checker.cpp
parente9c903f1ea480b9f873c81c4acc43fcb1e437d48 (diff)
Improve support for `freestanding_wasm32`
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 5d8d6dcdc..f544ea5e6 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -2660,10 +2660,14 @@ DECL_ATTRIBUTE_PROC(proc_decl_attribute) {
}
return true;
} else if (name == "require") {
- if (value != nullptr) {
- error(elem, "'require' does not have any parameters");
+ ExactValue ev = check_decl_attribute_value(c, value);
+ if (ev.kind == ExactValue_Invalid) {
+ ac->require_declaration = true;
+ } else if (ev.kind == ExactValue_Bool) {
+ ac->require_declaration = ev.value_bool;
+ } else {
+ error(value, "Expected either a boolean or no parameter for 'require'");
}
- ac->require_declaration = true;
return true;
} else if (name == "init") {
if (value != nullptr) {