Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#84 closed defect (fixed)

tuple pointer assignment

Reported by: pabuhr Owned by: Rob Schluntz
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description (last modified by Rob Schluntz)

struct S {
    int i, * p;
};
void ?{}( S & s, int & x ) {
    s.[p, i] =	[&x, 0];
}
int main() {
    int i;
    S s = { i };
    i = *s.p;
}

test.c: In function '___constructor__F_R2sSRi__1':
test.c:8:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
     s.[p, i] = [&x, 0];

Cforall Runtime error (UNIX pid:9572) Addressing invalid memory at location (nil)
Possible cause is reading outside the address space or writing to a protected area within the address space with an invalid pointer or subscript.
Stack back trace for: a.out
(0) a.out : __main__Fi___1 + 0x2e  [0x4014e9]
Abort (core dumped)

A simpler example:

int main() {
  int i;
  int & x = i;
  int *&r = &x;
}

Change History (3)

comment:1 Changed 7 years ago by Rob Schluntz

Description: modified (diff)
Owner: set to Rob Schluntz
Status: newassigned

comment:2 Changed 7 years ago by Rob Schluntz <rschlunt@…>

Resolution: fixed
Status: assignedclosed

In a3323db:

add a cast to every address-of function argument and initializer [fixes #84]

comment:3 Changed 7 years ago by Rob Schluntz <rschlunt@…>

In a3323db:

add a cast to every address-of function argument and initializer [fixes #84]

Note: See TracTickets for help on using tickets.