浏览代码

fixed virtual/virtual comparison

Nicolas Cannasse 9 年之前
父节点
当前提交
b10a957e05
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/generators/hl2c.ml

+ 3 - 1
src/generators/hl2c.ml

@@ -811,7 +811,9 @@ let write_c version file (code:code) =
 							sexpr "if( %s && %s && %s(%s,%s) %s 0 ) goto %s" (reg a) (reg b) funnames.(fid) (reg a) (reg b) (s_comp op) (label d)
 							sexpr "if( %s && %s && %s(%s,%s) %s 0 ) goto %s" (reg a) (reg b) funnames.(fid) (reg a) (reg b) (s_comp op) (label d)
 					with Not_found ->
 					with Not_found ->
 						phys_compare())
 						phys_compare())
-				| HEnum _, HEnum _ | HVirtual _, HVirtual _ | HDynObj, HDynObj ->
+				| HVirtual _, HVirtual _ ->
+					sexpr "if( %s %s %s || (%s && %s && %s->value && %s->value && %s->value %s %s->value) ) goto %s" (reg a) (s_comp op) (reg b) (reg a) (reg b) (reg a) (reg b) (reg a) (s_comp op) (reg b) (label d)
+				| HEnum _, HEnum _ | HDynObj, HDynObj ->
 					phys_compare()
 					phys_compare()
 				| HVirtual _, HObj _->
 				| HVirtual _, HObj _->
 					if op = CEq then
 					if op = CEq then