https://issues.dlang.org/show_bug.cgi?id=24460
Bolpat changed:
What|Removed |Added
CC||qs.il.paperi...@gmail.com
--- Comment #3 from
|--- |FIXED
--- Comment #11 from Dlang Bot ---
dlang/dmd pull request #16510 "fix issue24534 : goto can skip declarations in
labeled statements without error" was merged into master:
- 7f30b66d3dae37544c7629af1178f908984c2a93 by Ben Jones:
Fix Bugzilla Issue 24534 : got
https://issues.dlang.org/show_bug.cgi?id=24534
--- Comment #10 from Ben ---
"Since this is used in C code quite often, and therefore ported code (such as
dmd's backend)."
>From what I can tell, there's only one place in the whole compiler that's
affected by this bug, so I don't think this is
https://issues.dlang.org/show_bug.cgi?id=24534
--- Comment #9 from Jonathan M Davis ---
(In reply to Richard (Rikki) Andrew Cattermole from comment #7)
> But, it is also desirable to skip variable declarations, as long as you
> don't touch them you do not violate the spec clause.
The spec
:
```
Label:
SomethingWithSideEffects var = 0;
try
{
if (uniform01() > 0.5)
return 0;
goto Label;
}
finally
var.~this();
```
This means only forward goto's have broken analysis.
--
https://issues.dlang.org/show_bug.cgi?id=24534
--- Comment #7 from Richard (Rikki) Andrew Cattermole
---
It is a bug in the compiler, I agree on that too.
But, it is also desirable to skip variable declarations, as long as you don't
touch them you do not violate the spec clause.
Since this is
https://issues.dlang.org/show_bug.cgi?id=24534
Jonathan M Davis changed:
What|Removed |Added
Severity|enhancement |normal
--- Comment #6 from Jonathan M
---
@benjones updated dlang/dmd pull request #16510 "fix issue24534 : goto can skip
declarations in labeled statements without error" fixing this issue:
- Fix Bugzilla Issue 24534 : goto can skip declarations in labeled statements
without error
https://github.com/dlang/dmd/pull/16510
--
https://issues.dlang.org/show_bug.cgi?id=24534
--- Comment #4 from Ben ---
Gotta be a bug:
void f2(){ //compiles fine
int x2;
goto Label2;
Dummy2:
int y2;
Label2:
int z2;
}
GotoStatement::semantic() for Label2
goto lastvar: x2
LabelStatement::semantic() for Dummy2
https://issues.dlang.org/show_bug.cgi?id=24534
--- Comment #3 from Jonathan M Davis ---
Well, it's in clear violation of the spec:
https://dlang.org/spec/statement.html#goto-statement
So, either the spec is wrong, or dmd is.
Also, if you slap @safe on main, it compiles even though
error.
It is very C style, and is used in dmd.
The solution of course would be to create a new scope so it doesn't bleed
between the labels.
```d
goto Lerror;
Lsuccess:
{
}
Lerror:
{
}
```
If this is fixed, it's going to need a very long deprecation.
Or we could kill off this logic entirely
https://issues.dlang.org/show_bug.cgi?id=24534
Ben changed:
What|Removed |Added
CC||ben.james.jo...@gmail.com
--- Comment #1 from Ben
https://issues.dlang.org/show_bug.cgi?id=24535
Ben changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
list for the goto from the label.
I looked into it fairly recently as an example of type state analysis D
is already designed against.
On Friday, 3 May 2024 at 20:38:31 UTC, Jonathan M Davis wrote:
https://issues.dlang.org/show_bug.cgi?id=24535
On Friday, May 3, 2024 2:38:31 PM MDT Jonathan M Davis via Digitalmars-d-learn
wrote:
> On Friday, May 3, 2024 1:15:16 PM MDT Ben Jones via Digitalmars-d-learn
wrote:
> > In general, you can't skip a declaration with goto, but it seems
> > to be allowed if the declaration
https://issues.dlang.org/show_bug.cgi?id=24535
Issue ID: 24535
Summary: Accepts Invalid: goto can skip declarations if they're
labelled
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status
https://issues.dlang.org/show_bug.cgi?id=24534
Jonathan M Davis changed:
What|Removed |Added
Keywords||accepts-invalid
--
https://issues.dlang.org/show_bug.cgi?id=24534
Issue ID: 24534
Summary: Having a label on a declaration makes it possible to
skip it with goto
Product: D
Version: D2
Hardware: All
OS: All
Status
On Friday, May 3, 2024 1:15:16 PM MDT Ben Jones via Digitalmars-d-learn wrote:
> In general, you can't skip a declaration with goto, but it seems
> to be allowed if the declaration you're skipping is labelled...
> Is that expected or an accepts invalid bug?
>
> https://godbolt.
In general, you can't skip a declaration with goto, but it seems
to be allowed if the declaration you're skipping is labelled...
Is that expected or an accepts invalid bug?
https://godbolt.org/z/4qx8Pf6G7
```d
void f1(){ //fails with error about skipping a declaration
int x;
goto
https://issues.dlang.org/show_bug.cgi?id=24460
elpenguin...@gmail.com changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
https://issues.dlang.org/show_bug.cgi?id=24460
elpenguin...@gmail.com changed:
What|Removed |Added
See Also||https://issues.dlang.org/sh
https://issues.dlang.org/show_bug.cgi?id=24460
--- Comment #2 from RazvanN ---
Scratch that. The problem is that you are not rethrowing the exception/error if
you use a goto.
--
https://issues.dlang.org/show_bug.cgi?id=24460
RazvanN changed:
What|Removed |Added
CC||razvan.nitu1...@gmail.com
--- Comment #1 from
https://issues.dlang.org/show_bug.cgi?id=24460
Issue ID: 24460
Summary: scope(failure) with a goto breaks safety
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: accepts-invalid, safe
https://issues.dlang.org/show_bug.cgi?id=24356
--- Comment #1 from Carl Sturtivant ---
Created attachment 1904
--> https://issues.dlang.org/attachment.cgi?id=1904=edit
Work around for goto case CTFE bug
Shows that goto case does work with the computed label.
--
https://issues.dlang.org/show_bug.cgi?id=24356
Issue ID: 24356
Summary: goto case label not correctly generated by CTFE
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
https://issues.dlang.org/show_bug.cgi?id=24291
--- Comment #9 from Walter Bright ---
At least I can get you a better error message:
https://github.com/dlang/dmd/pull/15967
--
compile |ImportC: support computed
|janet.c |goto
OS|Linux |All
--- Comment #8 from Walter Bright ---
I'm going to leave this as an enhancement request for computed goto. If there
are other ImportC problems with janet
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dmd pull request #15651 "Fix issue 24174 - [CTFE] goto within with
statements & catch blocks cause a infinite loop" was merged into master:
- 62c233919c06e4d2aa79449f83b1bd52d84b0a11 by Mai-Lapyst:
Fix issue 24174 - [CTF
-Lapyst created dlang/dmd pull request #15651 "Fix issue 24174 - [CTFE]
goto within with statements & catch blocks cause a infinite loop" fixing this
issue:
- Fix issue 24174 - [CTFE] goto within with statements & catch blocks cause a
infinite loop
https://github.com/dlang/dmd/pull/15651
--
https://issues.dlang.org/show_bug.cgi?id=24174
Issue ID: 24174
Summary: [CTFE] goto within with statements & catch blocks
cause a infinite loop
Product: D
Version: D2
Hardware: All
OS: All
St
https://issues.dlang.org/show_bug.cgi?id=22688
Steven Schveighoffer changed:
What|Removed |Added
CC||schvei...@gmail.com
--
https://issues.dlang.org/show_bug.cgi?id=20179
RazvanN changed:
What|Removed |Added
CC||razvan.nitu1...@gmail.com
--- Comment #1 from
Treleaven ---
run.dlang.io gives:
2.075.1 to 2.087.1: Failure with output: onlineapp.d(7): Error: `goto` skips
declaration of variable `onlineapp.test.b` at onlineapp.d(9)
Since 2.088.1: Failure with output: onlineapp.d(7): Error: cannot `goto`
into `try` block
Possibly related to Issue 20096
https://issues.dlang.org/show_bug.cgi?id=22688
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=21694
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P2
--
https://issues.dlang.org/show_bug.cgi?id=21571
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=22995
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P3
--
https://issues.dlang.org/show_bug.cgi?id=20179
Iain Buclaw changed:
What|Removed |Added
Priority|P1 |P4
--
https://issues.dlang.org/show_bug.cgi?id=23271
Dlang Bot changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=23271
Dlang Bot changed:
What|Removed |Added
Keywords||pull
--- Comment #1 from Dlang Bot ---
https://issues.dlang.org/show_bug.cgi?id=23271
Issue ID: 23271
Summary: `goto` skips declaration of variable
`bugred.A.test.__appendtmp4`
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
https://issues.dlang.org/show_bug.cgi?id=22995
Issue ID: 22995
Summary: goto case cannot forward to outer case label
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dmd pull request #13913 "fix Issue 22933 - importC: goto skips
declaration of variable" was merged into master:
- cd51b32e3c452e3a366430ed22ff7e006483dc9e by Walter Bright:
fix Issue 22933 - importC: goto skips declaration o
---
@WalterBright created dlang/dmd pull request #13913 "fix Issue 22933 - importC:
goto skips declaration of variable" fixing this issue:
- fix Issue 22933 - importC: goto skips declaration of variable
https://github.com/dlang/dmd/pull/13913
--
https://issues.dlang.org/show_bug.cgi?id=22933
Issue ID: 22933
Summary: importC: goto skips declaration of variable
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC, rejects-valid
https://issues.dlang.org/show_bug.cgi?id=22688
moonlightsenti...@disroot.org changed:
What|Removed |Added
CC||moonlightsentinel@disroot.o
https://issues.dlang.org/show_bug.cgi?id=22688
Issue ID: 22688
Summary: Control flow analysis is confused by goto case in loop
Product: D
Version: D2
Hardware: x86_64
OS: All
Status: NEW
Severity: major
ssue 22415 - importC: Deprecation: switch case fallthrough - use 'goto
case;' if intended
* ImportC: improve parsing error message
Co-authored-by: Walter Bright
https://github.com/dlang/dmd/pull/13421
--
eprecation: switch case fallthrough - use 'goto
case;' if intended
https://github.com/dlang/dmd/pull/13344
--
witch case fallthrough - use 'goto
case;' if intended
https://github.com/dlang/dmd/pull/13283
--
---
@WalterBright created dlang/dmd pull request #13283 "fix Issue 22415 - ImportC:
Deprecation: switch case fallthrough - use…" fixing this issue:
- fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto
case;' if intended
https://github.com/dlang/dmd/pull/13283
--
https://issues.dlang.org/show_bug.cgi?id=22415
Iain Buclaw changed:
What|Removed |Added
Keywords||diagnostic, ImportC,
|
https://issues.dlang.org/show_bug.cgi?id=22415
Issue ID: 22415
Summary: importC: Deprecation: switch case fallthrough - use
'goto case;' if intended
Product: D
Version: D2
Hardware: All
OS: All
https://issues.dlang.org/show_bug.cgi?id=21985
Dlang Bot changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=21985
Dlang Bot changed:
What|Removed |Added
Keywords||pull
--- Comment #1 from Dlang Bot ---
https://issues.dlang.org/show_bug.cgi?id=21985
Basile-z changed:
What|Removed |Added
Keywords||diagnostic
Severity|enhancement
https://issues.dlang.org/show_bug.cgi?id=21985
Issue ID: 21985
Summary: "goto" errors with unexistent label report
wrong/misleading line
Product: D
Version: D2
Hardware: All
OS: All
S
https://issues.dlang.org/show_bug.cgi?id=13815
Dlang Bot changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
https://issues.dlang.org/show_bug.cgi?id=13815
Dlang Bot changed:
What|Removed |Added
Keywords||pull
--- Comment #1 from Dlang Bot ---
https://issues.dlang.org/show_bug.cgi?id=21694
--- Comment #2 from Răzvan Ștefănescu ---
The error message is not swallowed because the code is lowered in a 'try {goto}
finally', therefore there is no b declaration to jump over in the same scope as
goto after lowering.
If you replace the goto
RazvanN ---
Actually, the goto is not legal because it skips the declaration of b. For
example, this does not compile:
struct A { /*~this() {}*/ }
void test(int x)
{
{
A a;
goto END;
}
A b;
END:
}
onlineapp.d(7): Error: goto skips declaration of variable onlineapp.test.b
https://issues.dlang.org/show_bug.cgi?id=21694
Issue ID: 21694
Summary: Misleading error message and invalid goto error
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
https://issues.dlang.org/show_bug.cgi?id=21571
Stefan changed:
What|Removed |Added
CC||kde...@vogtner.de
--
https://issues.dlang.org/show_bug.cgi?id=21571
Issue ID: 21571
Summary: goto across assignment to AA fails and reports false
Error
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
On Thursday, 26 November 2020 at 04:42:08 UTC, Dukc wrote:
On Wednesday, 25 November 2020 at 18:44:52 UTC, NonNull wrote:
Is there a good way to simulate computed goto in D?
I haven't used assembly myself, but it's possible that you can
define a mixin that does this, using inline assembly
On Wednesday, 25 November 2020 at 18:57:35 UTC, Paul Backus wrote:
On Wednesday, 25 November 2020 at 18:44:52 UTC, NonNull wrote:
How good is optimization in ldc2, gdc, dmd at compiling
chained jumps into one jump each time?
The easiest way to find the answer to a question like this is
to
On Wednesday, 25 November 2020 at 20:05:28 UTC, NonNull wrote:
So to simulate computed goto have to
1. wrap switch(x) in a loop [ while(0) ]
2. inside each case recompute x (instead of jump to computed y)
3. jump back to execute switch again [ continue ]
It does look as if a nested switch can
On Wednesday, 25 November 2020 at 18:44:52 UTC, NonNull wrote:
Is there a good way to simulate computed goto in D?
I haven't used assembly myself, but it's possible that you can
define a mixin that does this, using inline assembly.
any such
chained jumps. But if performance is important to you, I
recommend *not* bothering with dmd.
Yes this is about efficiency.
Is there a good way to simulate computed goto in D?
With a switch statement. ;)
OK, so I took a look at switch documentation and tried out
something. It looked
On Wed, Nov 25, 2020 at 06:44:52PM +, NonNull via Digitalmars-d-learn wrote:
> For automatically generated code of some low level kinds it is
> convenient to have "computed goto" like this:
>
> https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
&g
On Wednesday, 25 November 2020 at 18:44:52 UTC, NonNull wrote:
How good is optimization in ldc2, gdc, dmd at compiling chained
jumps into one jump each time?
The easiest way to find the answer to a question like this is to
use the compiler explorer:
https://d.godbolt.org/
For automatically generated code of some low level kinds it is
convenient to have "computed goto" like this:
https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
and D does not have this.
A switch could be used to simulate it. But this would lead to
what could have been a s
https://issues.dlang.org/show_bug.cgi?id=20179
Mathias LANG changed:
What|Removed |Added
OS|Mac OS X|All
--
https://issues.dlang.org/show_bug.cgi?id=20179
Issue ID: 20179
Summary: 'goto' skips over declaration triggered for unused
variable
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
|--- |FIXED
--- Comment #2 from Dlang Bot ---
dlang/dmd pull request #10266 "fix Issue 20096 - error message 'cannot goto
into try block' is follo…" was merged into stable:
- 4442cc705190b33b60bc3ed4ffe7d553f340b367 by Walter Bright:
fix Issue 20096 - error message 'cannot got
---
@WalterBright created dlang/dmd pull request #10266 "fix Issue 20096 - error
message 'cannot goto into try block' is follo…" fixing this issue:
- fix Issue 20096 - error message 'cannot goto into try block' is followed by
seg fault
https://github.com/dlang/dmd/pull/10266
--
https://issues.dlang.org/show_bug.cgi?id=20096
Walter Bright changed:
What|Removed |Added
Keywords||ice-on-invalid-code
--
https://issues.dlang.org/show_bug.cgi?id=20096
Issue ID: 20096
Summary: error message 'cannot goto into try block' is followed
by seg fault
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
https://issues.dlang.org/show_bug.cgi?id=19213
--- Comment #7 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/6572e4abb338127e2fd12cd562133e8f71a35311
Fix Issue 19213 - goto skips declaration of variable
https://issues.dlang.org/show_bug.cgi?id=19213
github-bugzi...@puremagic.com changed:
What|Removed |Added
Status|NEW |RESOLVED
https://issues.dlang.org/show_bug.cgi?id=19213
--- Comment #6 from Eduard Staniloiu ---
(In reply to kinke from comment #5)
> While I'm not convinced the `goto`s in the `pop{Front,Back}EmptyElements`
> mixins in Phobos are the most elegant way of expressing the logic, the
...@gmx.net ---
While I'm not convinced the `goto`s in the `pop{Front,Back}EmptyElements`
mixins in Phobos are the most elegant way of expressing the logic, the issue is
that the frontend warns about a skipped *temporary* variable declaration, whose
lifetime doesn't extend to the goto target.
It may
https://issues.dlang.org/show_bug.cgi?id=19213
--- Comment #4 from arne.lud...@posteo.de ---
I reduced the example a bit more. The struct is not involved in the error.
import std.algorithm;
import std.range;
void main()
{
auto results = [[1,2], [3,4]]
.map!(q =>
https://issues.dlang.org/show_bug.cgi?id=19213
Eduard Staniloiu changed:
What|Removed |Added
CC||edi33...@gmail.com
https://issues.dlang.org/show_bug.cgi?id=19011
Rainer Schuetze changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
On Thursday, 8 November 2018 at 09:34:34 UTC, Michelle Long wrote:
What I am talking about is about an obvious error...
OK, so here are your code slightly modified:
void main(){
int i;
W:
if(i==0)
goto Q;
int x;
Q:
i++;
if(i==1)
goto W;
writeln
s been
people talking passed each other without really coming to an
understanding, which always makes for a frustrating discussion.
The problem has to do with communication and assumptions.
I'd like to help, but I don't know what else I can say. I've
tried to explain how braces interact with goto
ding, which always makes for a frustrating discussion.
I'd like to help, but I don't know what else I can say. I've tried to
explain how braces interact with goto and why, so you should be able to
figure out whether you're dealing with a compiler bug or not. And if you
are, unless you're dealing with
ong
> via
>
> Digitalmars- d-learn wrote:
>> Don't let their psychobabble fool you. They are wrong and
>> you were right from the start.
>
> ...
>
>> Case A:
>> {
>>
>> if (true) goto X;
>> int x;
>>
>> }
>>
learn wrote:
> >> Don't let their psychobabble fool you. They are wrong and you
> >> were right from the start.
> >
> > ...
> >
> >> Case A:
> >> {
> >>
> >> if (true) goto X;
> >> int x;
> &g
On Thursday, 8 November 2018 at 02:22:42 UTC, Jonathan M Davis
wrote:
On Wednesday, November 7, 2018 1:03:47 PM MST Michelle Long via
Digitalmars- d-learn wrote:
Don't let their psychobabble fool you. They are wrong and you
were right from the start.
...
Case A:
{
if (true) goto X
On Wednesday, November 7, 2018 1:03:47 PM MST Michelle Long via Digitalmars-
d-learn wrote:
> Don't let their psychobabble fool you. They are wrong and you
> were right from the start.
...
> Case A:
> {
> if (true) goto X;
> int x;
> }
> X:
>
>
> C
On Wednesday, 7 November 2018 at 20:03:47 UTC, Michelle Long
wrote:
Case A:
int x;
{
if (true) goto X;
//int x;
}
~x;
X:
That is not "Case A". This one is:
{
if (true) goto X;
T x;
X:
} // x.__dtor
That should error as an easy cop-out, nothing wrong with that
And I found a bit strange that in such code, since "x" is
>> never used, why it isn't skipped.
>
> It's skipped right over. The goto jumps out of the scope,
> and the line with
>
> int x;
>
> is never run. In fact, if you compile with -w or -wi, th
ot; is
>> never used, why it isn't skipped.
>
> It's skipped right over. The goto jumps out of the scope,
> and the line with
>
> int x;
>
> is never run. In fact, if you compile with -w or -wi, the
> compiler will give you a warning about unreachable code.
Tha
pped.
> >
> > It's skipped right over. The goto jumps out of the scope, and
> > the line with
> >
> > int x;
> >
> > is never run. In fact, if you compile with -w or -wi, the
> > compiler will give you a warning about unreachable code.
>
> That is ex
be enough instead of an error.
On the other hand, if there is a possibility that the variable
can be accessed, then an error should be throw.
Like:
{
goto Q:
int x;
Q:
x = 10; // An error is ok.
}
But here:
{
goto Q:
int x; // An warning should be enough in my IMHO.
Q
1 - 100 of 447 matches
Mail list logo