Forráskód Böngészése

[eval] just print "Null Access" instead of something more useful

closes #7735
Simon Krajewski 6 éve
szülő
commit
350058c290
2 módosított fájl, 8 hozzáadás és 2 törlés
  1. 4 1
      src/macro/eval/evalEmitter.ml
  2. 4 1
      src/macro/eval/evalExceptions.ml

+ 4 - 1
src/macro/eval/evalEmitter.ml

@@ -31,7 +31,10 @@ open EvalMisc
 (* Helper *)
 
 let unexpected_value_p v s p =
-	let str = Printf.sprintf "Unexpected value %s, expected %s" (value_string v) s in
+	let str = match v with
+		| VNull -> "Null Access"
+		| _ -> Printf.sprintf "Unexpected value %s, expected %s" (value_string v) s
+	in
 	throw_string str p
 
 let as_array p = function

+ 4 - 1
src/macro/eval/evalExceptions.ml

@@ -78,7 +78,10 @@ let s_value_kind = function
 	| VLazy _ -> "VLazy"
 
 let unexpected_value : 'a . value -> string -> 'a = fun v s ->
-	let str = Printf.sprintf "Unexpected value %s(%s), expected %s" (s_value_kind v) (value_string v) s in
+	let str = match v with
+		| VNull -> "Null Access"
+		| _ -> Printf.sprintf "Unexpected value %s(%s), expected %s" (s_value_kind v) (value_string v) s
+	in
 	exc_string str
 
 let invalid_call_arg_number i i2 =