소스 검색

[ilib] Handle null value in System.Type instance (#9948)

Required for UnityEditor 2020.1.10

Fixes #9946
Rudy Ges 4 년 전
부모
커밋
65bb88834c
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      libs/ilib/ilMetaReader.ml

+ 5 - 2
libs/ilib/ilMetaReader.ml

@@ -1556,8 +1556,11 @@ let read_custom_attr ctx attr_type s pos =
 			let pos, cons = read_constant ctx (sig_to_const ilsig) s pos in
 			pos, InstConstant (cons)
 		| SClass c when is_type (["System"],"Type") c ->
-			let pos, len = read_compressed_i32 s pos in
-			pos+len, InstType (String.sub s pos len)
+			if (sget s pos) == 0xff then
+				pos+1, InstConstant INull
+			else
+				let pos, len = read_compressed_i32 s pos in
+				pos+len, InstType (String.sub s pos len)
 		| SType ->
 			let pos, len = read_compressed_i32 s pos in
 			pos+len, InstType (String.sub s pos len)