소스 검색

[eval] don't throw upon casting (null:String) to NativeString

Aleksandr Kuzmenko 4 년 전
부모
커밋
8ff7c404f8
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/macro/eval/evalStdLib.ml

+ 3 - 2
src/macro/eval/evalStdLib.ml

@@ -3075,8 +3075,9 @@ end
 
 module StdNativeString = struct
 	let from_string = vfun1 (fun v ->
-		let s = decode_vstring v in
-		vnative_string s.sstring
+		match decode_optional decode_vstring v with
+		| None -> vnull
+		| Some s -> vnative_string s.sstring
 	)
 
 	let from_bytes = vfun1 (fun v ->