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
fc713bfc
Commit
fc713bfc
authored
Nov 13, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added bytecode support for arrays.
parent
f3e1f700
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
2 deletions
+57
-2
compile.c
dlls/vbscript/compile.c
+40
-2
interp.c
dlls/vbscript/interp.c
+9
-0
vbscript.h
dlls/vbscript/vbscript.h
+8
-0
No files found.
dlls/vbscript/compile.c
View file @
fc713bfc
...
@@ -937,8 +937,9 @@ static HRESULT compile_dim_statement(compile_ctx_t *ctx, dim_statement_t *stat)
...
@@ -937,8 +937,9 @@ static HRESULT compile_dim_statement(compile_ctx_t *ctx, dim_statement_t *stat)
ctx
->
func
->
var_cnt
++
;
ctx
->
func
->
var_cnt
++
;
if
(
dim_decl
->
is_array
)
{
if
(
dim_decl
->
is_array
)
{
FIXME
(
"arrays not supported
\n
"
);
HRESULT
hres
=
push_instr_bstr_uint
(
ctx
,
OP_dim
,
dim_decl
->
name
,
ctx
->
func
->
array_cnt
++
);
return
E_NOTIMPL
;
if
(
FAILED
(
hres
))
return
hres
;
}
}
if
(
!
dim_decl
->
next
)
if
(
!
dim_decl
->
next
)
...
@@ -1302,6 +1303,41 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f
...
@@ -1302,6 +1303,41 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f
}
}
}
}
if
(
func
->
array_cnt
)
{
unsigned
dim_cnt
,
array_id
=
0
;
dim_decl_t
*
dim_decl
;
dim_list_t
*
iter
;
func
->
array_descs
=
compiler_alloc
(
ctx
->
code
,
func
->
array_cnt
*
sizeof
(
array_desc_t
));
if
(
!
func
->
array_descs
)
return
E_OUTOFMEMORY
;
for
(
dim_decl
=
ctx
->
dim_decls
;
dim_decl
;
dim_decl
=
dim_decl
->
next
)
{
if
(
!
dim_decl
->
is_array
)
continue
;
dim_cnt
=
0
;
for
(
iter
=
dim_decl
->
dims
;
iter
;
iter
=
iter
->
next
)
dim_cnt
++
;
func
->
array_descs
[
array_id
].
bounds
=
compiler_alloc
(
ctx
->
code
,
dim_cnt
*
sizeof
(
SAFEARRAYBOUND
));
if
(
!
func
->
array_descs
[
array_id
].
bounds
)
return
E_OUTOFMEMORY
;
func
->
array_descs
[
array_id
].
dim_cnt
=
dim_cnt
;
dim_cnt
=
0
;
for
(
iter
=
dim_decl
->
dims
;
iter
;
iter
=
iter
->
next
)
{
func
->
array_descs
[
array_id
].
bounds
[
dim_cnt
].
cElements
=
iter
->
val
+
1
;
func
->
array_descs
[
array_id
].
bounds
[
dim_cnt
++
].
lLbound
=
0
;
}
array_id
++
;
}
assert
(
array_id
==
func
->
array_cnt
);
}
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1337,6 +1373,7 @@ static HRESULT create_function(compile_ctx_t *ctx, function_decl_t *decl, functi
...
@@ -1337,6 +1373,7 @@ static HRESULT create_function(compile_ctx_t *ctx, function_decl_t *decl, functi
func
->
vars
=
NULL
;
func
->
vars
=
NULL
;
func
->
var_cnt
=
0
;
func
->
var_cnt
=
0
;
func
->
array_cnt
=
0
;
func
->
code_ctx
=
ctx
->
code
;
func
->
code_ctx
=
ctx
->
code
;
func
->
type
=
decl
->
type
;
func
->
type
=
decl
->
type
;
func
->
is_public
=
decl
->
is_public
;
func
->
is_public
=
decl
->
is_public
;
...
@@ -1637,6 +1674,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
...
@@ -1637,6 +1674,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
ret
->
main_code
.
code_ctx
=
ret
;
ret
->
main_code
.
code_ctx
=
ret
;
ret
->
main_code
.
vars
=
NULL
;
ret
->
main_code
.
vars
=
NULL
;
ret
->
main_code
.
var_cnt
=
0
;
ret
->
main_code
.
var_cnt
=
0
;
ret
->
main_code
.
array_cnt
=
0
;
ret
->
main_code
.
arg_cnt
=
0
;
ret
->
main_code
.
arg_cnt
=
0
;
ret
->
main_code
.
args
=
NULL
;
ret
->
main_code
.
args
=
NULL
;
...
...
dlls/vbscript/interp.c
View file @
fc713bfc
...
@@ -887,6 +887,15 @@ static HRESULT interp_new(exec_ctx_t *ctx)
...
@@ -887,6 +887,15 @@ static HRESULT interp_new(exec_ctx_t *ctx)
return
stack_push
(
ctx
,
&
v
);
return
stack_push
(
ctx
,
&
v
);
}
}
static
HRESULT
interp_dim
(
exec_ctx_t
*
ctx
)
{
const
BSTR
ident
=
ctx
->
instr
->
arg1
.
bstr
;
const
unsigned
array_id
=
ctx
->
instr
->
arg2
.
uint
;
FIXME
(
"%s(%d)
\n
"
,
debugstr_w
(
ident
),
array_id
);
return
E_NOTIMPL
;
}
static
HRESULT
interp_step
(
exec_ctx_t
*
ctx
)
static
HRESULT
interp_step
(
exec_ctx_t
*
ctx
)
{
{
const
BSTR
ident
=
ctx
->
instr
->
arg2
.
bstr
;
const
BSTR
ident
=
ctx
->
instr
->
arg2
.
bstr
;
...
...
dlls/vbscript/vbscript.h
View file @
fc713bfc
...
@@ -212,6 +212,7 @@ typedef enum {
...
@@ -212,6 +212,7 @@ typedef enum {
X(case, 0, ARG_ADDR, 0) \
X(case, 0, ARG_ADDR, 0) \
X(concat, 1, 0, 0) \
X(concat, 1, 0, 0) \
X(const, 1, ARG_BSTR, 0) \
X(const, 1, ARG_BSTR, 0) \
X(dim, 1, ARG_BSTR, ARG_UINT) \
X(div, 1, 0, 0) \
X(div, 1, 0, 0) \
X(double, 1, ARG_DOUBLE, 0) \
X(double, 1, ARG_DOUBLE, 0) \
X(empty, 1, 0, 0) \
X(empty, 1, 0, 0) \
...
@@ -299,6 +300,11 @@ typedef struct {
...
@@ -299,6 +300,11 @@ typedef struct {
const
WCHAR
*
name
;
const
WCHAR
*
name
;
}
var_desc_t
;
}
var_desc_t
;
typedef
struct
{
unsigned
dim_cnt
;
SAFEARRAYBOUND
*
bounds
;
}
array_desc_t
;
struct
_function_t
{
struct
_function_t
{
function_type_t
type
;
function_type_t
type
;
const
WCHAR
*
name
;
const
WCHAR
*
name
;
...
@@ -307,6 +313,8 @@ struct _function_t {
...
@@ -307,6 +313,8 @@ struct _function_t {
unsigned
arg_cnt
;
unsigned
arg_cnt
;
var_desc_t
*
vars
;
var_desc_t
*
vars
;
unsigned
var_cnt
;
unsigned
var_cnt
;
array_desc_t
*
array_descs
;
unsigned
array_cnt
;
unsigned
code_off
;
unsigned
code_off
;
vbscode_t
*
code_ctx
;
vbscode_t
*
code_ctx
;
function_t
*
next
;
function_t
*
next
;
...
...
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