Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/tools/wasm-ctor-eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,16 @@ void evalCtors(Module& wasm,
}
}
} catch (FailToEvalException& fail) {
// that's it, we failed to even create the instance
// That's it, we failed to even create the instance.
if (!quiet) {
std::cout << " ...stopping since could not create module instance: "
<< fail.why << "\n";
}
} catch (NonconstantException& fail) {
// We can also fail during start due to a non-constant operation.
if (!quiet) {
std::cout << " ...stopping since non-constant in start\n";
}
} catch (TopologicalSort::CycleException e) {
// We use a topological sort for GC globals. If there is a non-breakable
// cycle there, we will hit an error (we can break cycles in nullable and
Expand Down
38 changes: 38 additions & 0 deletions test/lit/ctor-eval/start-nonconstant.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited.
;; RUN: foreach %s %t wasm-ctor-eval --ctors=test --kept-exports=test --quiet -all -S -o - | filecheck %s

;; A non-constant (relaxed SIMD) operation in the start function. We should not
;; error.
(module
;; CHECK: (type $0 (func (param v128)))

;; CHECK: (type $1 (func))

;; CHECK: (import "a" "b" (func $import (type $0) (param v128)))
(import "a" "b" (func $import (param v128)))

;; CHECK: (export "test" (func $0))
(export "test" (func $0))

;; CHECK: (start $0)
(start $0)

;; CHECK: (func $0 (type $1)
;; CHECK-NEXT: (call $import
;; CHECK-NEXT: (f32x4.relaxed_min
;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $0
;; The import avoids vacuum from removing the entire body.
(call $import
(f32x4.relaxed_min
(v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
(v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
)
)
)
)

Loading