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
d01d6294
Commit
d01d6294
authored
Aug 22, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Handle long/short distinction in interpreter.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a390b7e8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
28 deletions
+14
-28
compile.c
dlls/vbscript/compile.c
+1
-3
interp.c
dlls/vbscript/interp.c
+7
-14
lex.c
dlls/vbscript/lex.c
+3
-4
parse.h
dlls/vbscript/parse.h
+0
-1
parser.y
dlls/vbscript/parser.y
+3
-5
vbscript.h
dlls/vbscript/vbscript.h
+0
-1
No files found.
dlls/vbscript/compile.c
View file @
d01d6294
...
...
@@ -536,8 +536,6 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr)
return
push_instr_str
(
ctx
,
OP_string
,
((
string_expression_t
*
)
expr
)
->
value
);
case
EXPR_SUB
:
return
compile_binary_expression
(
ctx
,
(
binary_expression_t
*
)
expr
,
OP_sub
);
case
EXPR_USHORT
:
return
push_instr_int
(
ctx
,
OP_short
,
((
int_expression_t
*
)
expr
)
->
value
);
case
EXPR_ULONG
:
return
push_instr_int
(
ctx
,
OP_long
,
((
int_expression_t
*
)
expr
)
->
value
);
case
EXPR_XOR
:
...
...
@@ -781,7 +779,7 @@ static HRESULT compile_forto_statement(compile_ctx_t *ctx, forto_statement_t *st
if
(
!
push_instr
(
ctx
,
OP_val
))
return
E_OUTOFMEMORY
;
}
else
{
hres
=
push_instr_int
(
ctx
,
OP_
short
,
1
);
hres
=
push_instr_int
(
ctx
,
OP_
long
,
1
);
if
(
FAILED
(
hres
))
return
hres
;
}
...
...
dlls/vbscript/interp.c
View file @
d01d6294
...
...
@@ -1322,20 +1322,13 @@ static HRESULT interp_long(exec_ctx_t *ctx)
TRACE
(
"%d
\n
"
,
arg
);
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
arg
;
return
stack_push
(
ctx
,
&
v
);
}
static
HRESULT
interp_short
(
exec_ctx_t
*
ctx
)
{
const
LONG
arg
=
ctx
->
instr
->
arg1
.
lng
;
VARIANT
v
;
TRACE
(
"%d
\n
"
,
arg
);
V_VT
(
&
v
)
=
VT_I2
;
V_I2
(
&
v
)
=
arg
;
if
(
arg
==
(
INT16
)
arg
)
{
V_VT
(
&
v
)
=
VT_I2
;
V_I2
(
&
v
)
=
arg
;
}
else
{
V_VT
(
&
v
)
=
VT_I4
;
V_I4
(
&
v
)
=
arg
;
}
return
stack_push
(
ctx
,
&
v
);
}
...
...
dlls/vbscript/lex.c
View file @
d01d6294
...
...
@@ -334,9 +334,8 @@ static int parse_numeric_literal(parser_ctx_t *ctx, void **ret)
}
if
(
use_int
&&
(
LONG
)
d
==
d
)
{
LONG
l
=
d
;
*
(
LONG
*
)
ret
=
l
;
return
(
short
)
l
==
l
?
tShort
:
tLong
;
*
(
LONG
*
)
ret
=
d
;
return
tLong
;
}
r
=
exp
>=
0
?
d
*
pow
(
10
,
exp
)
:
d
/
pow
(
10
,
-
exp
);
...
...
@@ -377,7 +376,7 @@ static int parse_hex_literal(parser_ctx_t *ctx, LONG *ret)
ctx
->
ptr
++
;
*
ret
=
l
;
return
(
short
)
l
==
l
?
tShort
:
tLong
;
return
tLong
;
}
static
void
skip_spaces
(
parser_ctx_t
*
ctx
)
...
...
dlls/vbscript/parse.h
View file @
d01d6294
...
...
@@ -50,7 +50,6 @@ typedef enum {
EXPR_STRING
,
EXPR_SUB
,
EXPR_ULONG
,
EXPR_USHORT
,
EXPR_XOR
}
expression_type_t
;
...
...
dlls/vbscript/parser.y
View file @
d01d6294
...
...
@@ -119,7 +119,7 @@ static statement_t *link_statements(statement_t*,statement_t*);
%token <string> tNEXT tON tRESUME tGOTO
%token <string> tIdentifier tString
%token <string> tDEFAULT tERROR tEXPLICIT tPROPERTY tSTEP
%token <lng> tLong
tShort
%token <lng> tLong
%token <dbl> tDouble
%type <statement> Statement SimpleStatement StatementNl StatementsNl StatementsNl_opt IfStatement Else_opt
...
...
@@ -381,14 +381,12 @@ LiteralExpression
| tNOTHING { $$ = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; }
NumericLiteralExpression
: tShort { $$ = new_long_expression(ctx, EXPR_USHORT, $1); CHECK_ERROR; }
| '0' { $$ = new_long_expression(ctx, EXPR_USHORT, 0); CHECK_ERROR; }
: '0' { $$ = new_long_expression(ctx, EXPR_ULONG, 0); CHECK_ERROR; }
| tLong { $$ = new_long_expression(ctx, EXPR_ULONG, $1); CHECK_ERROR; }
| tDouble { $$ = new_double_expression(ctx, $1); CHECK_ERROR; }
IntegerValue
: tShort { $$ = $1; }
| '0' { $$ = 0; }
: '0' { $$ = 0; }
| tLong { $$ = $1; }
PrimaryExpression
...
...
dlls/vbscript/vbscript.h
View file @
d01d6294
...
...
@@ -272,7 +272,6 @@ typedef enum {
X(ret, 0, 0, 0) \
X(set_ident, 1, ARG_BSTR, ARG_UINT) \
X(set_member, 1, ARG_BSTR, ARG_UINT) \
X(short, 1, ARG_INT, 0) \
X(step, 0, ARG_ADDR, ARG_BSTR) \
X(stop, 1, 0, 0) \
X(string, 1, ARG_STR, 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