浏览代码

Fix for a possible NULL dereference issue.

Marco Bambini 7 年之前
父节点
当前提交
51eb59d927
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/compiler/gravity_optimizer.c

+ 2 - 0
src/compiler/gravity_optimizer.c

@@ -259,6 +259,8 @@ inline static inst_t *current_instruction (ircode_t *code, uint32_t i) {
 // MARK: -
 
 static bool optimize_const_instruction (inst_t *inst, inst_t *inst1, inst_t *inst2) {
+    if (!inst2) return false;
+    
 	// select type algorithm:
 	// two numeric types are supported here, int64 or double
 	// if types are equals then set the first one