2
0
Эх сурвалжийг харах

[jvm] fix null-to-basetype

see #9647
Simon Krajewski 5 жил өмнө
parent
commit
6164ff3a28

+ 1 - 1
src/generators/genjvm.ml

@@ -1710,7 +1710,7 @@ class texpr_to_jvm gctx (jc : JvmClass.builder) (jm : JvmMethod.builder) (return
 			end
 			end
 		| TBool true -> code#bconst true
 		| TBool true -> code#bconst true
 		| TBool false -> code#bconst false
 		| TBool false -> code#bconst false
-		| TNull -> code#aconst_null (self#vtype t)
+		| TNull -> jm#load_default_value (self#vtype t)
 		| TThis ->
 		| TThis ->
 			let _,load,_ = self#get_local_by_id (0,"this") in
 			let _,load,_ = self#get_local_by_id (0,"this") in
 			load()
 			load()