Skip to content

Commit

Permalink
this lang has some bugs I don't remember encountering in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
dvtate committed Mar 3, 2024
1 parent d8c19dc commit a2af9f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ find_package(Threads REQUIRED)
link_libraries(dl)

# Debug
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -lefence -g -Wall -Wextra")
#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -Wall -Wextra")
# Production
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g")

set(SOURCE_FILES
util.cpp util.hpp debug.hpp
Expand Down
6 changes: 3 additions & 3 deletions vm/operators/internal_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace vm_util {
f.gc_make<LambdaReturnNativeFn>(f));

//
f.rt->running->stack.emplace_back(new Frame(f.rt, c));
f.rt->running->stack.emplace_back(std::make_shared<Frame>(f.rt, c));
return;
}

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

// Out of range
if (index >= list.size())
if (index >= (ValueTypes::int_t) list.size())
return Value();

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

// Out of range
if (index >= str.size())
if (index >= (ValueTypes::int_t) str.size())
return Value();

// Return indexed value
Expand Down
2 changes: 1 addition & 1 deletion vm/vm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Frame {
std::vector<Value> eval_stack;

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

~Frame() {}
Expand Down

0 comments on commit a2af9f9

Please sign in to comment.