Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
pikelang
pike
Commits
01543a00
Commit
01543a00
authored
Jul 06, 2020
by
Stephen R. van den Berg
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stdio.Buffer: Check for PIKE_T_FUNCTION before acting on objects.
parent
082c9bea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
src/modules/_Stdio/buffer.cmod
src/modules/_Stdio/buffer.cmod
+7
-12
No files found.
src/modules/_Stdio/buffer.cmod
View file @
01543a00
...
...
@@ -455,16 +455,14 @@ PIKECLASS Buffer
PMOD_EXPORT
void
io_actually_trigger_output
(
Buffer
*
io
)
{
if
(
UNLIKELY
(
!
io
->
output
.
u
.
object
->
prog
)
)
{
/* Destructed object. */
free_svalue
(
&
io
->
output
);
SET_SVAL
(
io
->
output
,
PIKE_T_INT
,
NUMBER_NUMBER
,
integer
,
0
);
return
;
}
if
(
io
->
output
.
t
u
.
named_type
==
PIKE_T_FUNCTION
)
{
if
(
UNLIKELY
(
!
io
->
output
.
u
.
object
->
prog
))
{
/* Destructed object. */
free_svalue
(
&
io
->
output
);
return
;
}
if
(
io
->
output
.
u
.
object
)
{
move_svalue
(
Pike_sp
++
,
&
io
->
output
);
SET_SVAL
(
io
->
output
,
PIKE_T_INT
,
NUMBER_NUMBER
,
integer
,
0
);
apply_svalue
(
Pike_sp
-
1
,
0
);
pop_n_elems
(
2
);
}
...
...
@@ -990,11 +988,8 @@ PIKECLASS Buffer
if
(
f
)
assign_svalue
(
&
io
->
output
,
f
);
else
{
if
(
io
->
output
.
u
.
object
)
{
if
(
io
->
output
.
t
u
.
named_type
==
PIKE_T_FUNCTION
)
free_svalue
(
&
io
->
output
);
io
->
output
.
u
.
object
=
0
;
// free_svalue() puts in -1
}
SET_SVAL
(
io
->
output
,
PIKE_T_INT
,
NUMBER_NUMBER
,
integer
,
0
);
}
}
...
...
Henrik (Grubba) Grubbström
@grubba
mentioned in commit
7a725efa
·
Aug 02, 2020
mentioned in commit
7a725efa
mentioned in commit 7a725efa2a3a2faa207fe29886b8b42cc21d0aea
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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