Closed awelzel closed 3 months ago
Not exactly sure why we never set up a scope, but the following patch seems to fix this particular compilation time issue:
diff --git a/hilti/toolchain/src/ast/scope-lookup.cc b/hilti/toolchain/src/ast/scope-lookup.cc
index 9de3eaf9e..d2e5cd42e 100644
--- a/hilti/toolchain/src/ast/scope-lookup.cc
+++ b/hilti/toolchain/src/ast/scope-lookup.cc
@@ -11,6 +11,9 @@
using namespace hilti;
std::pair<bool, Result<std::pair<Declaration*, ID>>> hilti::scope::detail::lookupID(const ID& id, const Node* n) {
+ if ( ! n || ! n->scope() )
+ return {false, result::Error("cannot perform lookup if node or scope is missing")};
+
auto resolved = n->scope()->lookupAll(id);
if ( resolved.empty() ) {
As for actually running Spicy parsers under UBSAN, it seems to run into a lot of issues around fiber stack offsets (likely a FP?).
<...>/fiber.cc:275:40: runtime error: applying non-zero offset 18446744073709551615 to null pointer
I wasn't successful in writing a suppression for this, and it might require coming up with a separate impl for UBSAN (we already have some of that for ASAN in hilti/runtime/src/fiber.cc
).
Related to zeek/zeek#3670.
Building Zeek with
--sanitziers=undefined
, triggers the following undefined behavior splash while compiling any of the Spicy analyzers.Found when removing
--disable-spicy
from the ubsan CI task configuration.https://cirrus-ci.com/task/4699588039278592?logs=build#L3291