Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b0dcbbdb
Commit
b0dcbbdb
authored
Jul 28, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscipt: Use passed copy of arguments if they are alread at the top of the stack.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e4d3826
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
engine.c
dlls/jscript/engine.c
+17
-11
No files found.
dlls/jscript/engine.c
View file @
b0dcbbdb
...
...
@@ -2591,19 +2591,25 @@ static HRESULT bind_event_target(script_ctx_t *ctx, function_code_t *func, jsdis
static
HRESULT
setup_scope
(
script_ctx_t
*
ctx
,
call_frame_t
*
frame
,
unsigned
argc
,
jsval_t
*
argv
)
{
const
unsigned
orig_stack
=
ctx
->
stack_top
;
unsigned
i
;
jsval_t
v
;
HRESULT
hres
;
frame
->
arguments_off
=
ctx
->
stack_top
;
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
hres
=
jsval_copy
(
argv
[
i
],
&
v
);
if
(
SUCCEEDED
(
hres
))
hres
=
stack_push
(
ctx
,
v
);
if
(
FAILED
(
hres
))
{
stack_popn
(
ctx
,
i
);
return
hres
;
/* If arguments are already on the stack, we may use them. */
if
(
argv
+
argc
==
ctx
->
stack
+
ctx
->
stack_top
)
{
frame
->
arguments_off
=
argv
-
ctx
->
stack
;
i
=
argc
;
}
else
{
frame
->
arguments_off
=
ctx
->
stack_top
;
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
hres
=
jsval_copy
(
argv
[
i
],
&
v
);
if
(
SUCCEEDED
(
hres
))
hres
=
stack_push
(
ctx
,
v
);
if
(
FAILED
(
hres
))
{
stack_popn
(
ctx
,
i
);
return
hres
;
}
}
}
...
...
@@ -2611,12 +2617,12 @@ static HRESULT setup_scope(script_ctx_t *ctx, call_frame_t *frame, unsigned argc
for
(;
i
<
frame
->
function
->
param_cnt
;
i
++
)
{
hres
=
stack_push
(
ctx
,
jsval_undefined
());
if
(
FAILED
(
hres
))
{
stack_popn
(
ctx
,
i
);
stack_popn
(
ctx
,
ctx
->
stack_top
-
orig_stack
);
return
hres
;
}
}
frame
->
pop_locals
=
i
;
frame
->
pop_locals
=
ctx
->
stack_top
-
orig_stack
;
frame
->
base_scope
->
frame
=
frame
;
return
S_OK
;
}
...
...
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