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
51f65ec9
Commit
51f65ec9
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_new handler.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d0803612
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
9 deletions
+33
-9
compile.c
dlls/jscript/compile.c
+9
-1
engine.c
dlls/jscript/engine.c
+23
-8
engine.h
dlls/jscript/engine.h
+1
-0
No files found.
dlls/jscript/compile.c
View file @
51f65ec9
...
...
@@ -558,7 +558,15 @@ static HRESULT compile_new_expression(compiler_ctx_t *ctx, call_expression_t *ex
arg_cnt
++
;
}
return
push_instr_uint
(
ctx
,
OP_new
,
arg_cnt
);
hres
=
push_instr_uint
(
ctx
,
OP_new
,
arg_cnt
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
push_instr_uint
(
ctx
,
OP_pop
,
arg_cnt
+
1
);
if
(
FAILED
(
hres
))
return
hres
;
return
push_instr
(
ctx
,
OP_push_ret
)
?
S_OK
:
E_OUTOFMEMORY
;
}
static
HRESULT
compile_call_expression
(
compiler_ctx_t
*
ctx
,
call_expression_t
*
expr
,
BOOL
emit_ret
)
...
...
dlls/jscript/engine.c
View file @
51f65ec9
...
...
@@ -201,6 +201,11 @@ static inline jsval_t steal_ret(call_frame_t *frame)
return
r
;
}
static
inline
void
clear_ret
(
call_frame_t
*
frame
)
{
jsval_release
(
steal_ret
(
frame
));
}
static
void
exprval_release
(
exprval_t
*
val
)
{
switch
(
val
->
type
)
{
...
...
@@ -941,8 +946,8 @@ static HRESULT interp_refval(script_ctx_t *ctx)
static
HRESULT
interp_new
(
script_ctx_t
*
ctx
)
{
const
unsigned
argc
=
get_op_uint
(
ctx
,
0
);
jsval_t
r
,
constr
;
HRESULT
hres
;
call_frame_t
*
frame
=
ctx
->
call_ctx
;
jsval_t
constr
;
TRACE
(
"%d
\n
"
,
argc
);
...
...
@@ -957,12 +962,9 @@ static HRESULT interp_new(script_ctx_t *ctx)
else
if
(
!
get_object
(
constr
))
return
throw_type_error
(
ctx
,
JS_E_INVALID_PROPERTY
,
NULL
);
hres
=
disp_call_value
(
ctx
,
get_object
(
constr
),
NULL
,
DISPATCH_CONSTRUCT
,
argc
,
stack_args
(
ctx
,
argc
),
&
r
);
if
(
FAILED
(
hres
))
return
hres
;
stack_popn
(
ctx
,
argc
+
1
);
return
stack_push
(
ctx
,
r
);
clear_ret
(
frame
);
return
disp_call_value
(
ctx
,
get_object
(
constr
),
NULL
,
DISPATCH_CONSTRUCT
,
argc
,
stack_args
(
ctx
,
argc
),
&
frame
->
ret
);
}
/* ECMA-262 3rd Edition 11.2.3 */
...
...
@@ -2353,6 +2355,19 @@ static HRESULT interp_setret(script_ctx_t *ctx)
return
S_OK
;
}
static
HRESULT
interp_push_ret
(
script_ctx_t
*
ctx
)
{
call_frame_t
*
frame
=
ctx
->
call_ctx
;
HRESULT
hres
;
TRACE
(
"
\n
"
);
hres
=
stack_push
(
ctx
,
frame
->
ret
);
if
(
SUCCEEDED
(
hres
))
frame
->
ret
=
jsval_undefined
();
return
hres
;
}
typedef
HRESULT
(
*
op_func_t
)(
script_ctx_t
*
);
static
const
op_func_t
op_funcs
[]
=
{
...
...
dlls/jscript/engine.h
View file @
51f65ec9
...
...
@@ -70,6 +70,7 @@
X(postinc, 1, ARG_INT, 0) \
X(preinc, 1, ARG_INT, 0) \
X(push_except,1, ARG_ADDR, ARG_BSTR) \
X(push_ret, 1, 0,0) \
X(push_scope, 1, 0,0) \
X(regexp, 1, ARG_STR, ARG_UINT) \
X(rshift, 1, 0,0) \
...
...
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