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
39d34532
Commit
39d34532
authored
Oct 10, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Undefined variables resolve as EMPTY without Option Explicit.
parent
fad3ca07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
interp.c
dlls/vbscript/interp.c
+17
-3
run.c
dlls/vbscript/tests/run.c
+10
-0
No files found.
dlls/vbscript/interp.c
View file @
39d34532
...
...
@@ -206,7 +206,8 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_
return
S_OK
;
}
static
HRESULT
add_dynamic_var
(
exec_ctx_t
*
ctx
,
const
WCHAR
*
name
,
BOOL
is_const
,
VARIANT
*
val
,
BOOL
own_val
)
static
HRESULT
add_dynamic_var
(
exec_ctx_t
*
ctx
,
const
WCHAR
*
name
,
BOOL
is_const
,
VARIANT
*
val
,
BOOL
own_val
,
VARIANT
**
out_var
)
{
dynamic_var_t
*
new_var
;
vbsheap_t
*
heap
;
...
...
@@ -245,6 +246,9 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, BOOL is_const
ctx
->
dynamic_vars
=
new_var
;
}
if
(
out_var
)
*
out_var
=
&
new_var
->
v
;
return
S_OK
;
}
...
...
@@ -526,6 +530,16 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
}
break
;
case
REF_NONE
:
if
(
res
&&
!
ctx
->
func
->
code_ctx
->
option_explicit
&&
arg_cnt
==
0
)
{
VARIANT
v
,
*
new
;
VariantInit
(
&
v
);
hres
=
add_dynamic_var
(
ctx
,
identifier
,
FALSE
,
&
v
,
FALSE
,
&
new
);
if
(
FAILED
(
hres
))
return
hres
;
V_VT
(
res
)
=
VT_BYREF
|
VT_VARIANT
;
V_BYREF
(
res
)
=
new
;
break
;
}
FIXME
(
"%s not found
\n
"
,
debugstr_w
(
identifier
));
return
DISP_E_UNKNOWNNAME
;
}
...
...
@@ -653,7 +667,7 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, DISPPARAMS *dp)
}
TRACE
(
"creating variable %s
\n
"
,
debugstr_w
(
name
));
hres
=
add_dynamic_var
(
ctx
,
name
,
FALSE
,
dp
->
rgvarg
,
FALSE
);
hres
=
add_dynamic_var
(
ctx
,
name
,
FALSE
,
dp
->
rgvarg
,
FALSE
,
NULL
);
}
}
...
...
@@ -810,7 +824,7 @@ static HRESULT interp_const(exec_ctx_t *ctx)
if
(
FAILED
(
hres
))
return
hres
;
return
add_dynamic_var
(
ctx
,
arg
,
TRUE
,
val
.
v
,
val
.
owned
);
return
add_dynamic_var
(
ctx
,
arg
,
TRUE
,
val
.
v
,
val
.
owned
,
NULL
);
}
static
HRESULT
interp_val
(
exec_ctx_t
*
ctx
)
...
...
dlls/vbscript/tests/run.c
View file @
39d34532
...
...
@@ -1780,6 +1780,8 @@ static void run_from_res(const char *name)
static
void
run_tests
(
void
)
{
HRESULT
hres
;
strict_dispid_check
=
TRUE
;
parse_script_a
(
""
);
...
...
@@ -1880,6 +1882,14 @@ static void run_tests(void)
"End Sub
\n
"
"Call testsub()"
);
parse_script_a
(
"Call ok(getVT(x) =
\"
VT_EMPTY*
\"
,
\"
getVT(x) =
\"
& getVT(x))
\n
"
);
parse_script_a
(
"Call ok(x =
\"\"
,
\"
x =
\"
& x)
\n
"
);
parse_script_a
(
"x = y
\n
"
"Call ok(getVT(x) =
\"
VT_EMPTY*
\"
,
\"
getVT(x) =
\"
& getVT(x))
\n
"
"Call ok(getVT(y) =
\"
VT_EMPTY*
\"
,
\"
getVT(y) =
\"
& getVT(y))"
);
hres
=
parse_script_ar
(
"x = y(
\"
a
\"
)"
);
ok
(
FAILED
(
hres
),
"script didn't fail
\n
"
);
run_from_res
(
"lang.vbs"
);
run_from_res
(
"api.vbs"
);
...
...
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