Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4bef35fd
Commit
4bef35fd
authored
Mar 28, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Clear stack outside OP_call* handlers.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
51f65ec9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
20 deletions
+18
-20
compile.c
dlls/jscript/compile.c
+9
-2
engine.c
dlls/jscript/engine.c
+9
-18
No files found.
dlls/jscript/compile.c
View file @
4bef35fd
...
...
@@ -571,7 +571,7 @@ static HRESULT compile_new_expression(compiler_ctx_t *ctx, call_expression_t *ex
static
HRESULT
compile_call_expression
(
compiler_ctx_t
*
ctx
,
call_expression_t
*
expr
,
BOOL
emit_ret
)
{
unsigned
arg_cnt
=
0
;
unsigned
arg_cnt
=
0
,
extra_args
;
argument_t
*
arg
;
unsigned
instr
;
jsop_t
op
;
...
...
@@ -579,9 +579,11 @@ static HRESULT compile_call_expression(compiler_ctx_t *ctx, call_expression_t *e
if
(
is_memberid_expr
(
expr
->
expression
->
type
))
{
op
=
OP_call_member
;
extra_args
=
2
;
hres
=
compile_memberid_expression
(
ctx
,
expr
->
expression
,
0
);
}
else
{
op
=
OP_call
;
extra_args
=
1
;
hres
=
compile_expression
(
ctx
,
expr
->
expression
,
TRUE
);
}
...
...
@@ -601,7 +603,12 @@ static HRESULT compile_call_expression(compiler_ctx_t *ctx, call_expression_t *e
instr_ptr
(
ctx
,
instr
)
->
u
.
arg
[
0
].
uint
=
arg_cnt
;
instr_ptr
(
ctx
,
instr
)
->
u
.
arg
[
1
].
lng
=
emit_ret
;
return
S_OK
;
hres
=
push_instr_uint
(
ctx
,
OP_pop
,
arg_cnt
+
extra_args
);
if
(
FAILED
(
hres
))
return
hres
;
return
!
emit_ret
||
push_instr
(
ctx
,
OP_push_ret
)
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
compile_delete_expression
(
compiler_ctx_t
*
ctx
,
unary_expression_t
*
expr
)
...
...
dlls/jscript/engine.c
View file @
4bef35fd
...
...
@@ -972,8 +972,8 @@ static HRESULT interp_call(script_ctx_t *ctx)
{
const
unsigned
argn
=
get_op_uint
(
ctx
,
0
);
const
int
do_ret
=
get_op_int
(
ctx
,
1
);
jsval_t
r
,
obj
;
HRESULT
hres
;
call_frame_t
*
frame
=
ctx
->
call_ctx
;
jsval_t
obj
;
TRACE
(
"%d %d
\n
"
,
argn
,
do_ret
);
...
...
@@ -981,13 +981,9 @@ static HRESULT interp_call(script_ctx_t *ctx)
if
(
!
is_object_instance
(
obj
))
return
throw_type_error
(
ctx
,
JS_E_INVALID_PROPERTY
,
NULL
);
hres
=
disp_call_value
(
ctx
,
get_object
(
obj
),
NULL
,
DISPATCH_METHOD
,
argn
,
stack_args
(
ctx
,
argn
),
do_ret
?
&
r
:
NULL
);
if
(
FAILED
(
hres
))
return
hres
;
stack_popn
(
ctx
,
argn
+
1
);
return
do_ret
?
stack_push
(
ctx
,
r
)
:
S_OK
;
clear_ret
(
frame
);
return
disp_call_value
(
ctx
,
get_object
(
obj
),
NULL
,
DISPATCH_METHOD
,
argn
,
stack_args
(
ctx
,
argn
),
do_ret
?
&
frame
->
ret
:
NULL
);
}
/* ECMA-262 3rd Edition 11.2.3 */
...
...
@@ -995,10 +991,9 @@ static HRESULT interp_call_member(script_ctx_t *ctx)
{
const
unsigned
argn
=
get_op_uint
(
ctx
,
0
);
const
int
do_ret
=
get_op_int
(
ctx
,
1
);
call_frame_t
*
frame
=
ctx
->
call_ctx
;
IDispatch
*
obj
;
jsval_t
r
;
DISPID
id
;
HRESULT
hres
;
TRACE
(
"%d %d
\n
"
,
argn
,
do_ret
);
...
...
@@ -1006,13 +1001,9 @@ static HRESULT interp_call_member(script_ctx_t *ctx)
if
(
!
obj
)
return
throw_type_error
(
ctx
,
id
,
NULL
);
hres
=
disp_call
(
ctx
,
obj
,
id
,
DISPATCH_METHOD
,
argn
,
stack_args
(
ctx
,
argn
),
do_ret
?
&
r
:
NULL
);
if
(
FAILED
(
hres
))
return
hres
;
stack_popn
(
ctx
,
argn
+
2
);
return
do_ret
?
stack_push
(
ctx
,
r
)
:
S_OK
;
clear_ret
(
frame
);
return
disp_call
(
ctx
,
obj
,
id
,
DISPATCH_METHOD
,
argn
,
stack_args
(
ctx
,
argn
),
do_ret
?
&
frame
->
ret
:
NULL
);
}
/* ECMA-262 3rd Edition 11.1.1 */
...
...
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