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
e70825b0
Commit
e70825b0
authored
Mar 01, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use jsstr_t as string argument type in OP_obj_prop.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
36e58035
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
22 deletions
+27
-22
compile.c
dlls/jscript/compile.c
+20
-19
engine.c
dlls/jscript/engine.c
+6
-2
engine.h
dlls/jscript/engine.h
+1
-1
No files found.
dlls/jscript/compile.c
View file @
e70825b0
...
...
@@ -262,6 +262,19 @@ static HRESULT push_instr_str(compiler_ctx_t *ctx, jsop_t op, const WCHAR *arg)
return
S_OK
;
}
static
HRESULT
push_instr_str_uint
(
compiler_ctx_t
*
ctx
,
jsop_t
op
,
jsstr_t
*
str
,
unsigned
arg2
)
{
unsigned
instr
;
instr
=
push_instr
(
ctx
,
op
);
if
(
!
instr
)
return
E_OUTOFMEMORY
;
instr_ptr
(
ctx
,
instr
)
->
u
.
arg
[
0
].
str
=
str
;
instr_ptr
(
ctx
,
instr
)
->
u
.
arg
[
1
].
uint
=
arg2
;
return
S_OK
;
}
static
HRESULT
push_instr_bstr
(
compiler_ctx_t
*
ctx
,
jsop_t
op
,
const
WCHAR
*
arg
)
{
unsigned
instr
;
...
...
@@ -833,26 +846,14 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_t *literal)
return
E_FAIL
;
}
static
HRESULT
literal_as_
bstr
(
compiler_ctx_t
*
ctx
,
literal_t
*
literal
,
BSTR
*
str
)
static
HRESULT
literal_as_
string
(
compiler_ctx_t
*
ctx
,
literal_t
*
literal
,
jsstr_t
*
*
str
)
{
switch
(
literal
->
type
)
{
case
LT_STRING
:
*
str
=
compiler_alloc_
bstr
(
ctx
,
literal
->
u
.
wstr
);
*
str
=
compiler_alloc_
string
(
ctx
,
literal
->
u
.
wstr
);
break
;
case
LT_DOUBLE
:
{
jsstr_t
*
jsstr
;
HRESULT
hres
;
hres
=
double_to_string
(
literal
->
u
.
dval
,
&
jsstr
);
if
(
FAILED
(
hres
))
return
hres
;
*
str
=
compiler_alloc_bstr_len
(
ctx
,
NULL
,
jsstr_length
(
jsstr
));
if
(
*
str
)
jsstr_flush
(
jsstr
,
*
str
);
jsstr_release
(
jsstr
);
break
;
}
case
LT_DOUBLE
:
return
double_to_string
(
literal
->
u
.
dval
,
str
);
DEFAULT_UNREACHABLE
;
}
...
...
@@ -889,14 +890,14 @@ static HRESULT compile_array_literal(compiler_ctx_t *ctx, array_literal_expressi
static
HRESULT
compile_object_literal
(
compiler_ctx_t
*
ctx
,
property_value_expression_t
*
expr
)
{
property_definition_t
*
iter
;
BSTR
name
;
jsstr_t
*
name
;
HRESULT
hres
;
if
(
!
push_instr
(
ctx
,
OP_new_obj
))
return
E_OUTOFMEMORY
;
for
(
iter
=
expr
->
property_list
;
iter
;
iter
=
iter
->
next
)
{
hres
=
literal_as_
bstr
(
ctx
,
iter
->
name
,
&
name
);
hres
=
literal_as_
string
(
ctx
,
iter
->
name
,
&
name
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -904,7 +905,7 @@ static HRESULT compile_object_literal(compiler_ctx_t *ctx, property_value_expres
if
(
FAILED
(
hres
))
return
hres
;
hres
=
push_instr_
b
str_uint
(
ctx
,
OP_obj_prop
,
name
,
iter
->
type
);
hres
=
push_instr_str_uint
(
ctx
,
OP_obj_prop
,
name
,
iter
->
type
);
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
dlls/jscript/engine.c
View file @
e70825b0
...
...
@@ -1444,16 +1444,20 @@ static HRESULT interp_new_obj(script_ctx_t *ctx)
/* ECMA-262 3rd Edition 11.1.5 */
static
HRESULT
interp_obj_prop
(
script_ctx_t
*
ctx
)
{
const
BSTR
name
=
get_op_b
str
(
ctx
,
0
);
jsstr_t
*
name_arg
=
get_op_
str
(
ctx
,
0
);
unsigned
type
=
get_op_uint
(
ctx
,
1
);
const
WCHAR
*
name
;
jsdisp_t
*
obj
;
jsval_t
val
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_
w
(
name
));
TRACE
(
"%s
\n
"
,
debugstr_
jsstr
(
name_arg
));
val
=
stack_pop
(
ctx
);
/* FIXME: we should pass it as jsstr_t */
name
=
jsstr_flatten
(
name_arg
);
assert
(
is_object_instance
(
stack_top
(
ctx
)));
obj
=
as_jsdisp
(
get_object
(
stack_top
(
ctx
)));
...
...
dlls/jscript/engine.h
View file @
e70825b0
...
...
@@ -66,7 +66,7 @@
X(new, 1, ARG_UINT, 0) \
X(new_obj, 1, 0,0) \
X(null, 1, 0,0) \
X(obj_prop, 1, ARG_
BSTR,
ARG_UINT) \
X(obj_prop, 1, ARG_
STR,
ARG_UINT) \
X(or, 1, 0,0) \
X(pop, 1, ARG_UINT, 0) \
X(pop_except, 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