Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
sapl-interpreter
Commits
562cb8de
Commit
562cb8de
authored
Jan 25, 2016
by
Laszlo Domoszlai
Browse files
fix print thunk bug (interference with the GC)
parent
320df7af
Changes
1
Hide whitespace changes
Inline
Side-by-side
interpreter/thunk.c
View file @
562cb8de
...
...
@@ -101,13 +101,19 @@ void print(bool force) {
}
else
{
int
arity
=
printDesc
(
thunk
->
desc
);
// Put the arguments on the stack before any "eval", otherwise GC
// may screws up the pointers
for
(
int
i
=
0
;
i
<
arity
;
i
++
)
{
push_a
(
thunk
->
_args
[
arity
-
i
-
1
]);
}
for
(
int
i
=
0
;
i
<
arity
;
i
++
)
{
printf
(
" "
);
push_a
(
thunk
->
_args
[
i
]);
if
(
force
)
thunk
->
_args
[
i
]
->
desc
->
eval
();
if
(
force
)
peek_a
()
->
desc
->
eval
();
print
(
force
);
}
}
printf
(
"]"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment