Bug 7522 – ICE(interpret.c) Accessing a non-static member without this
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-16T09:05:00Z
Last change time
2015-06-09T05:10:40Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
yebblies
Comments
Comment #0 by yebblies — 2012-02-16T09:05:06Z
struct S
{
int a;
int b;
}
int test7522()
{
S.a = 2;
return 1;
}
static assert(test7522());
assert interpret.c(100) v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()
Comment #1 by clugdbug — 2012-02-22T00:54:26Z
I think this is the same as bug 7536, which is fixed now.
I don't have time to check it now.
Comment #2 by yebblies — 2012-02-22T01:49:07Z
Nope, still happens.
Comment #3 by clugdbug — 2012-02-22T02:34:26Z
No, wait, this shouldn't compile at all. It should never reach CTFE.
Comment #4 by lovelydear — 2012-04-20T00:47:47Z
In 2.059 Win32
PS E:\DigitalMars\dmd2\samples> dmd bug.d
bug.d(9): Error: need 'this' to access member a
PS E:\DigitalMars\dmd2\samples>
Comment #5 by yebblies — 2012-04-20T00:57:44Z
(In reply to comment #4)
> In 2.059 Win32
>
> PS E:\DigitalMars\dmd2\samples> dmd bug.d
> bug.d(9): Error: need 'this' to access member a
> PS E:\DigitalMars\dmd2\samples>
That's odd, I still get the assertion failure with 2.060 head. (now on line 103)
Were you using the exact code in the original comment?
Chances are this is a bug where something that should be dealt with during semantic is dealt with in the glue layer. Probably getRightThis and friends in e2ir.c.
Comment #6 by lovelydear — 2012-04-20T01:21:42Z
Oh sorry for the trouble, my bad.
Comment #7 by clugdbug — 2012-04-20T02:48:04Z
(In reply to comment #5)
> (In reply to comment #4)
> > In 2.059 Win32
> >
> > PS E:\DigitalMars\dmd2\samples> dmd bug.d
> > bug.d(9): Error: need 'this' to access member a
> > PS E:\DigitalMars\dmd2\samples>
>
> That's odd, I still get the assertion failure with 2.060 head. (now on line
> 103)
> Were you using the exact code in the original comment?
>
> Chances are this is a bug where something that should be dealt with during
> semantic is dealt with in the glue layer. Probably getRightThis and friends in
> e2ir.c.
Exactly. There's still a fair number of those guys, they cause a lot of problems for CTFE, and they also make it hard for GDC/LDC since they need to generate those errors too.
Comment #8 by andrej.mitrovich — 2013-01-10T05:59:23Z
Can't reproduce in 2.061 release or git-head, removing D2 tag.