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
186 changes: 102 additions & 84 deletions src/compile.ml

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,19 @@ let as_seqT t =
| TupT ts -> ts
| _ -> [t]

(* Literals *)

let string_of_lit = function
| BoolLit false -> "false"
| BoolLit true -> "true"
| IntLit n
| NatLit n -> Value.Int.to_string n
| Word8Lit n -> Value.Word8.to_string n
| Word16Lit n -> Value.Word16.to_string n
| Word32Lit n -> Value.Word32.to_string n
| Word64Lit n -> Value.Word64.to_string n
| CharLit c -> string_of_int c
| NullLit -> "null"
| TextLit t -> t
| FloatLit f -> Value.Float.to_string f
| PreLit _ -> assert false
1 change: 1 addition & 0 deletions test/run-dfinity/ok/actor-reexport.dvm-run.ok
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
W, hypervisor: calling start failed with trap message: Uncaught RuntimeError: unreachable
TODO: non-closed actor
2 changes: 2 additions & 0 deletions test/run-dfinity/ok/array-out-of-bounds.dvm-run.ok
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
W, hypervisor: calling func$98 failed with trap message: Uncaught RuntimeError: unreachable
W, hypervisor: calling func$104 failed with trap message: Uncaught RuntimeError: unreachable
Array index out of bounds
Array index out of bounds
1 change: 1 addition & 0 deletions test/run-dfinity/ok/counter-class.dvm-run.ok
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
W, hypervisor: calling start failed with trap message: Uncaught RuntimeError: unreachable
TODO: non-closed actor
2 changes: 2 additions & 0 deletions test/run-dfinity/ok/overflow.dvm-run.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ W, hypervisor: calling func$110 failed with trap message: Uncaught RuntimeError:
W, hypervisor: calling func$116 failed with trap message: Uncaught RuntimeError: unreachable
This is reachable.
This is reachable.
Natural subtraction underflow
Natural subtraction underflow
This is reachable.
This is reachable.
10 changes: 5 additions & 5 deletions test/run/ok/overflow.wasm.stderr.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
compile_lit: Overflow in literal 9223372036854775808
compile_lit: Overflow in literal 9223372036854775808
compile_lit: Overflow in literal 9223372036854775808
compile_lit: Overflow in literal 72462525423451963967165868
compile_lit: Overflow in literal 1314235251543424342678909
compile_lit: Overflow in literal 9_223_372_036_854_775_808
compile_lit: Overflow in literal 9_223_372_036_854_775_808
compile_lit: Overflow in literal 9_223_372_036_854_775_808
compile_lit: Overflow in literal 72_462_525_423_451_963_967_165_868
compile_lit: Overflow in literal 1_314_235_251_543_424_342_678_909