From fa80bf79d1d990e13b5aa2a774443db9a79af2a5 Mon Sep 17 00:00:00 2001 From: zys Date: Thu, 4 Oct 2018 21:36:44 +0800 Subject: [PATCH 1/2] modify2bugs --- src/memory/heap.cpp | 2 +- src/memory/heap.hpp | 1 - src/util/map.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/memory/heap.cpp b/src/memory/heap.cpp index a0fbbcc..6a4eccd 100644 --- a/src/memory/heap.cpp +++ b/src/memory/heap.cpp @@ -1,7 +1,7 @@ #include "runtime/universe.hpp" #include "memory/heap.hpp" #include "memory/oopClosure.hpp" - +#include Heap* Heap::instance = NULL; size_t Heap::MAX_CAP = 2 * 1024 * 1024; diff --git a/src/memory/heap.hpp b/src/memory/heap.hpp index ff5d4d8..2e9a32d 100644 --- a/src/memory/heap.hpp +++ b/src/memory/heap.hpp @@ -2,7 +2,6 @@ #define MEMORY_HEAP_HPP #include -#include class HiObject; diff --git a/src/util/map.cpp b/src/util/map.cpp index d44971a..f6c9627 100644 --- a/src/util/map.cpp +++ b/src/util/map.cpp @@ -73,7 +73,7 @@ template V Map::remove(K k) { int i = index(k); - if (k < 0) + if (i < 0) return 0; V v = _entries[i]._v; -- Gitee From 9438e273807fea58c6c78f1fe9ac8741bc10c104 Mon Sep 17 00:00:00 2001 From: zys Date: Thu, 4 Oct 2018 21:38:30 +0800 Subject: [PATCH 2/2] modify2bugs --- src/runtime/interpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/interpreter.cpp b/src/runtime/interpreter.cpp index 1eb0172..45861dd 100644 --- a/src/runtime/interpreter.cpp +++ b/src/runtime/interpreter.cpp @@ -266,7 +266,7 @@ void Interpreter::eval_frame() { case ByteCode::PRINT_NEWLINE: printf("\n"); break; - + case ByteCode::INPLACE_ADD: case ByteCode::BINARY_ADD: v = POP(); w = POP(); -- Gitee