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
f8deed7c
Commit
f8deed7c
authored
Jul 03, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fixed function return crossing for loop.
parent
8de35a45
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
compile.c
dlls/vbscript/compile.c
+22
-3
lang.vbs
dlls/vbscript/tests/lang.vbs
+18
-0
No files found.
dlls/vbscript/compile.c
View file @
f8deed7c
...
...
@@ -946,6 +946,25 @@ static HRESULT compile_exitfor_statement(compile_ctx_t *ctx)
return
push_instr_addr
(
ctx
,
OP_jmp
,
iter
->
for_end_label
);
}
static
HRESULT
exit_label
(
compile_ctx_t
*
ctx
,
unsigned
jmp_label
)
{
statement_ctx_t
*
iter
;
unsigned
pop_cnt
=
0
;
for
(
iter
=
ctx
->
stat_ctx
;
iter
;
iter
=
iter
->
next
)
pop_cnt
+=
iter
->
stack_use
;
if
(
pop_cnt
)
{
HRESULT
hres
;
hres
=
push_instr_uint
(
ctx
,
OP_pop
,
pop_cnt
);
if
(
FAILED
(
hres
))
return
hres
;
}
return
push_instr_addr
(
ctx
,
OP_jmp
,
jmp_label
);
}
static
HRESULT
compile_exitsub_statement
(
compile_ctx_t
*
ctx
)
{
if
(
!
ctx
->
sub_end_label
)
{
...
...
@@ -953,7 +972,7 @@ static HRESULT compile_exitsub_statement(compile_ctx_t *ctx)
return
E_FAIL
;
}
return
push_instr_addr
(
ctx
,
OP_jmp
,
ctx
->
sub_end_label
);
return
exit_label
(
ctx
,
ctx
->
sub_end_label
);
}
static
HRESULT
compile_exitfunc_statement
(
compile_ctx_t
*
ctx
)
...
...
@@ -963,7 +982,7 @@ static HRESULT compile_exitfunc_statement(compile_ctx_t *ctx)
return
E_FAIL
;
}
return
push_instr_addr
(
ctx
,
OP_jmp
,
ctx
->
func_end_label
);
return
exit_label
(
ctx
,
ctx
->
func_end_label
);
}
static
HRESULT
compile_exitprop_statement
(
compile_ctx_t
*
ctx
)
...
...
@@ -973,7 +992,7 @@ static HRESULT compile_exitprop_statement(compile_ctx_t *ctx)
return
E_FAIL
;
}
return
push_instr_addr
(
ctx
,
OP_jmp
,
ctx
->
prop_end_label
);
return
exit_label
(
ctx
,
ctx
->
prop_end_label
);
}
static
HRESULT
compile_onerror_statement
(
compile_ctx_t
*
ctx
,
onerror_statement_t
*
stat
)
...
...
dlls/vbscript/tests/lang.vbs
View file @
f8deed7c
...
...
@@ -489,6 +489,13 @@ End Sub
Call
TestSubExit
(
true
)
Sub
TestSubExit2
for
x
=
1
to
100
Exit
Sub
next
End
Sub
Call
TestSubExit2
TestSubMultiArgs
1
,
2
,
3
,
4
,
5
Call
TestSubMultiArgs
(
1
,
2
,
3
,
4
,
5
)
...
...
@@ -584,6 +591,17 @@ End Function
Call
TestFuncExit
(
true
)
Function
TestFuncExit2
(
ByRef
a
)
For
x
=
1
to
100
For
y
=
1
to
100
Exit
Function
Next
Next
Call
ok
(
false
,
"Exit Function not called?"
)
End
Function
Call
TestFuncExit2
(
true
)
Sub
SubParseTest
End
Sub
:
x
=
false
Call
SubParseTest
...
...
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