소스 검색

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