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
685cd437
Commit
685cd437
authored
May 01, 2017
by
Jacek Caban
Committed by
Alexandre Julliard
May 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Pass finally offset instead of catch ident to OP_push_except.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8bd99c36
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
compile.c
dlls/jscript/compile.c
+5
-2
engine.c
dlls/jscript/engine.c
+11
-11
engine.h
dlls/jscript/engine.h
+1
-1
No files found.
dlls/jscript/compile.c
View file @
685cd437
...
...
@@ -1690,7 +1690,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat)
{
statement_ctx_t
try_ctx
=
{
0
,
FALSE
,
TRUE
},
catch_ctx
=
{
0
,
TRUE
,
FALSE
};
statement_ctx_t
finally_ctx
=
{
2
,
FALSE
,
FALSE
};
unsigned
push_except
;
unsigned
push_except
,
finally_off
=
0
,
catch_off
=
0
;
BSTR
ident
;
HRESULT
hres
;
...
...
@@ -1725,7 +1725,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat)
if
(
!
jmp_finally
)
return
E_OUTOFMEMORY
;
instr_ptr
(
ctx
,
push_except
)
->
u
.
arg
[
0
].
uint
=
ctx
->
code_off
;
catch_off
=
ctx
->
code_off
;
hres
=
push_instr_bstr
(
ctx
,
OP_enter_catch
,
ident
);
if
(
FAILED
(
hres
))
...
...
@@ -1744,6 +1744,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat)
}
if
(
stat
->
finally_statement
)
{
finally_off
=
ctx
->
code_off
;
hres
=
compile_statement
(
ctx
,
stat
->
catch_block
?
NULL
:
&
finally_ctx
,
stat
->
finally_statement
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -1752,6 +1753,8 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat)
return
E_OUTOFMEMORY
;
}
instr_ptr
(
ctx
,
push_except
)
->
u
.
arg
[
0
].
uint
=
catch_off
;
instr_ptr
(
ctx
,
push_except
)
->
u
.
arg
[
1
].
uint
=
finally_off
;
return
S_OK
;
}
...
...
dlls/jscript/engine.c
View file @
685cd437
...
...
@@ -41,7 +41,7 @@ struct _except_frame_t {
unsigned
stack_top
;
scope_chain_t
*
scope
;
unsigned
catch_off
;
BSTR
ident
;
unsigned
finally_off
;
except_frame_t
*
next
;
};
...
...
@@ -897,8 +897,8 @@ static HRESULT interp_throw_type(script_ctx_t *ctx)
/* ECMA-262 3rd Edition 12.14 */
static
HRESULT
interp_push_except
(
script_ctx_t
*
ctx
)
{
const
unsigned
arg1
=
get_op_uint
(
ctx
,
0
);
const
BSTR
arg2
=
get_op_bstr
(
ctx
,
1
);
const
unsigned
catch_off
=
get_op_uint
(
ctx
,
0
);
const
unsigned
finally_off
=
get_op_uint
(
ctx
,
1
);
call_frame_t
*
frame
=
ctx
->
call_ctx
;
except_frame_t
*
except
;
unsigned
stack_top
;
...
...
@@ -907,7 +907,7 @@ static HRESULT interp_push_except(script_ctx_t *ctx)
stack_top
=
ctx
->
stack_top
;
if
(
!
arg2
)
{
if
(
!
catch_off
)
{
HRESULT
hres
;
hres
=
stack_push
(
ctx
,
jsval_bool
(
TRUE
));
...
...
@@ -924,8 +924,8 @@ static HRESULT interp_push_except(script_ctx_t *ctx)
except
->
stack_top
=
stack_top
;
except
->
scope
=
frame
->
scope
;
except
->
catch_off
=
arg1
;
except
->
ident
=
arg2
;
except
->
catch_off
=
catch_off
;
except
->
finally_off
=
finally_off
;
except
->
next
=
frame
->
except_frame
;
frame
->
except_frame
=
except
;
return
S_OK
;
...
...
@@ -2657,7 +2657,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
except_frame_t
*
except_frame
;
call_frame_t
*
frame
;
jsval_t
except_val
;
BSTR
ident
;
unsigned
catch_off
;
HRESULT
hres
;
for
(
frame
=
ctx
->
call_ctx
;
!
frame
->
except_frame
;
frame
=
ctx
->
call_ctx
)
{
...
...
@@ -2675,7 +2675,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
}
except_frame
=
frame
->
except_frame
;
ident
=
except_frame
->
ident
;
catch_off
=
except_frame
->
catch_off
;
frame
->
except_frame
=
except_frame
->
next
;
assert
(
except_frame
->
stack_top
<=
ctx
->
stack_top
);
...
...
@@ -2684,8 +2684,8 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
while
(
except_frame
->
scope
!=
frame
->
scope
)
scope_pop
(
&
frame
->
scope
);
frame
->
ip
=
except_frame
->
catch
_off
;
if
(
ident
)
assert
(
frame
->
bytecode
->
instrs
[
frame
->
ip
].
op
==
OP_enter_catch
);
frame
->
ip
=
catch_off
?
catch_off
:
except_frame
->
finally
_off
;
if
(
catch_off
)
assert
(
frame
->
bytecode
->
instrs
[
frame
->
ip
].
op
==
OP_enter_catch
);
except_val
=
ctx
->
ei
.
val
;
ctx
->
ei
.
val
=
jsval_undefined
();
...
...
@@ -2697,7 +2697,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
ident
)
if
(
!
catch_off
)
hres
=
stack_push
(
ctx
,
jsval_bool
(
FALSE
));
return
hres
;
}
...
...
dlls/jscript/engine.h
View file @
685cd437
...
...
@@ -72,7 +72,7 @@
X(pop_scope, 1, 0,0) \
X(postinc, 1, ARG_INT, 0) \
X(preinc, 1, ARG_INT, 0) \
X(push_except,1, ARG_ADDR, ARG_
BSTR
) \
X(push_except,1, ARG_ADDR, ARG_
UINT
) \
X(push_ret, 1, 0,0) \
X(push_scope, 1, 0,0) \
X(regexp, 1, ARG_STR, ARG_UINT) \
...
...
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