815 – scope(exit) isn't executed when "continue" is used to continue a while-loop

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 815 - scope(exit) isn't executed when "continue" is used to continue a while-loop
Summary: scope(exit) isn't executed when "continue" is used to continue a while-loop
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P3 major
Assignee: Walter Bright
URL:
Keywords: wrong-code
Depends on:
Blocks:
Reported: 2007年01月07日 18:05 UTC by Thomas Kühne
Modified: 2014年02月15日 13:13 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Kühne 2007年01月07日 18:05:27 UTC
# import std.stdio;
#
# void main(){
# int i = 3;
# while(i--){
# scope(exit) writefln("scope(exit)");
# writefln("i: %s", i);
# if(i % 2) continue;
# }
#
# writefln("---");
#
# i = 3;
# while(i--){
# scope(success) writefln("scope(success)");
# writefln("i: %s", i);
# if(i % 2) continue;
# }
#
# }
output:
> i: 2
> scope(exit)
> i: 1
> i: 0
> scope(exit)
> ---
> i: 2
> scope(success)
> i: 1
> scope(success)
> i: 0
> scope(success)
expected output:
> i: 2
> scope(exit)
> i: 1
> scope(exit)
> i: 0
> scope(exit)
> ---
> i: 2
> scope(success)
> i: 1
> scope(success)
> i: 0
> scope(success)
Comment 1 Walter Bright 2007年01月09日 03:32:05 UTC
Only exhibits error on dmd for Linux, not for Windows.
Comment 2 Lars Ivar Igesund 2007年01月09日 03:49:08 UTC
Seems to fundamentally be the same issue as #621
Comment 3 Walter Bright 2007年01月27日 18:54:38 UTC
Fixed DMD 1.001
Comment 4 Thomas Kühne 2007年04月05日 05:28:01 UTC
Added to DStress as
http://dstress.kuehne.cn/run/s/scope_18_A.d
http://dstress.kuehne.cn/run/s/scope_18_B.d
http://dstress.kuehne.cn/run/s/scope_18_C.d
Seems to be fixed since DMD-1.001


AltStyle によって変換されたページ (->オリジナル) /