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
622eb728
Commit
622eb728
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: Added new opcode to enter catch block and use it to setup the scope.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7bb1667
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
22 deletions
+31
-22
compile.c
dlls/jscript/compile.c
+4
-0
engine.c
dlls/jscript/engine.c
+26
-22
engine.h
dlls/jscript/engine.h
+1
-0
No files found.
dlls/jscript/compile.c
View file @
622eb728
...
...
@@ -1720,6 +1720,10 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat)
instr_ptr
(
ctx
,
push_except
)
->
u
.
arg
[
0
].
uint
=
ctx
->
code_off
;
hres
=
push_instr_bstr
(
ctx
,
OP_enter_catch
,
ident
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
compile_statement
(
ctx
,
&
catch_ctx
,
stat
->
catch_block
->
statement
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/engine.c
View file @
622eb728
...
...
@@ -968,6 +968,26 @@ static HRESULT interp_end_finally(script_ctx_t *ctx)
return
S_OK
;
}
static
HRESULT
interp_enter_catch
(
script_ctx_t
*
ctx
)
{
const
BSTR
ident
=
get_op_bstr
(
ctx
,
0
);
jsdisp_t
*
scope_obj
;
jsval_t
v
;
HRESULT
hres
;
hres
=
create_dispex
(
ctx
,
NULL
,
NULL
,
&
scope_obj
);
if
(
FAILED
(
hres
))
return
hres
;
v
=
stack_pop
(
ctx
);
hres
=
jsdisp_propput_name
(
scope_obj
,
ident
,
v
);
jsval_release
(
v
);
if
(
SUCCEEDED
(
hres
))
hres
=
scope_push
(
ctx
->
call_ctx
->
scope
,
scope_obj
,
to_disp
(
scope_obj
),
&
ctx
->
call_ctx
->
scope
);
jsdisp_release
(
scope_obj
);
return
hres
;
}
/* ECMA-262 3rd Edition 13 */
static
HRESULT
interp_func
(
script_ctx_t
*
ctx
)
{
...
...
@@ -2655,6 +2675,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
}
except_frame
=
frame
->
except_frame
;
ident
=
except_frame
->
ident
;
frame
->
except_frame
=
except_frame
->
next
;
assert
(
except_frame
->
stack_top
<=
ctx
->
stack_top
);
...
...
@@ -2664,37 +2685,20 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres)
scope_pop
(
&
frame
->
scope
);
frame
->
ip
=
except_frame
->
catch_off
;
if
(
ident
)
assert
(
frame
->
bytecode
->
instrs
[
frame
->
ip
].
op
==
OP_enter_catch
);
except_val
=
ctx
->
ei
.
val
;
ctx
->
ei
.
val
=
jsval_undefined
();
clear_ei
(
ctx
);
ident
=
except_frame
->
ident
;
heap_free
(
except_frame
);
if
(
ident
)
{
jsdisp_t
*
scope_obj
;
hres
=
create_dispex
(
ctx
,
NULL
,
NULL
,
&
scope_obj
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
jsdisp_propput_name
(
scope_obj
,
ident
,
except_val
);
if
(
FAILED
(
hres
))
jsdisp_release
(
scope_obj
);
}
jsval_release
(
except_val
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
scope_push
(
frame
->
scope
,
scope_obj
,
to_disp
(
scope_obj
),
&
frame
->
scope
);
jsdisp_release
(
scope_obj
);
}
else
{
hres
=
stack_push
(
ctx
,
except_val
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
stack_push
(
ctx
,
except_val
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
ident
)
hres
=
stack_push
(
ctx
,
jsval_bool
(
FALSE
));
}
return
hres
;
}
...
...
dlls/jscript/engine.h
View file @
622eb728
...
...
@@ -35,6 +35,7 @@
X(div, 1, 0,0) \
X(double, 1, ARG_DBL, 0) \
X(end_finally,1, 0,0) \
X(enter_catch,1, ARG_BSTR, 0) \
X(eq, 1, 0,0) \
X(eq2, 1, 0,0) \
X(forin, 0, ARG_ADDR, 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