Skip to content

Commit 62f1991

Browse files
committed
fix: corrected an error that could lead to interpreter crash under certain conditions
1 parent 3f5c713 commit 62f1991

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

argon/vm/datatype/function.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ Function *FunctionClone(const Function *func) {
154154
if (fn != nullptr) {
155155
fn->native = func->native;
156156

157+
if (!func->IsNative())
158+
IncRef(fn->code);
159+
157160
fn->name = IncRef(func->name);
158161
fn->qname = IncRef(func->qname);
159162
fn->doc = IncRef(func->doc);

0 commit comments

Comments
 (0)