Skip to content

Commit a2af9f9

Browse files
committed
this lang has some bugs I don't remember encountering in the past
1 parent d8c19dc commit a2af9f9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ find_package(Threads REQUIRED)
1010
link_libraries(dl)
1111

1212
# Debug
13-
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -lefence -g -Wall -Wextra")
13+
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -Wall -Wextra")
1414
# Production
15-
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
15+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g")
1616

1717
set(SOURCE_FILES
1818
util.cpp util.hpp debug.hpp

vm/operators/internal_tools.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace vm_util {
3333
f.gc_make<LambdaReturnNativeFn>(f));
3434

3535
//
36-
f.rt->running->stack.emplace_back(new Frame(f.rt, c));
36+
f.rt->running->stack.emplace_back(std::make_shared<Frame>(f.rt, c));
3737
return;
3838
}
3939

@@ -59,7 +59,7 @@ namespace vm_util {
5959
index += list.size();
6060

6161
// Out of range
62-
if (index >= list.size())
62+
if (index >= (ValueTypes::int_t) list.size())
6363
return Value();
6464

6565
// Return indexed value
@@ -73,7 +73,7 @@ namespace vm_util {
7373
index += str.size();
7474

7575
// Out of range
76-
if (index >= str.size())
76+
if (index >= (ValueTypes::int_t) str.size())
7777
return Value();
7878

7979
// Return indexed value

vm/vm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class Frame {
227227
std::vector<Value> eval_stack;
228228

229229
Frame(Runtime* rt, Closure body, unsigned int pos = 0, std::vector<Value> eval_stack = {}):
230-
rt(rt), closure(body), pos(pos), eval_stack(std::move(eval_stack))
230+
rt(rt), closure(std::move(body)), pos(pos), eval_stack(std::move(eval_stack))
231231
{}
232232

233233
~Frame() {}

0 commit comments

Comments
 (0)