mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Compiler segfault when getting a nonexistant member from an unnamed struct #2533.
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
- Add ??? and +++= to list-precedence.
|
- Add ??? and +++= to list-precedence.
|
||||||
- Fix issues with linking when using symbol aliases. #2519
|
- Fix issues with linking when using symbol aliases. #2519
|
||||||
- Splatting optional compile-time macro parameter from inside lambda expression does not work #2532.
|
- Splatting optional compile-time macro parameter from inside lambda expression does not work #2532.
|
||||||
|
- Compiler segfault when getting a nonexistant member from an unnamed struct #2533.
|
||||||
|
|
||||||
### Stdlib changes
|
### Stdlib changes
|
||||||
- Sorting functions correctly took slices by value, but also other types by value. Now, only slices are accepted by value, other containers are always by ref.
|
- Sorting functions correctly took slices by value, but also other types by value. Now, only slices are accepted by value, other containers are always by ref.
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ const char *type_to_error_string(Type *type)
|
|||||||
if (!suffix && !type_is_inner_type(type)) return type->name;
|
if (!suffix && !type_is_inner_type(type)) return type->name;
|
||||||
scratch_buffer_clear();
|
scratch_buffer_clear();
|
||||||
type_add_parent_to_scratch(decl);
|
type_add_parent_to_scratch(decl);
|
||||||
scratch_buffer_append(decl->name);
|
scratch_buffer_append(decl->name ? decl->name : "(anon)");
|
||||||
if (suffix) scratch_buffer_append(suffix);
|
if (suffix) scratch_buffer_append(suffix);
|
||||||
return scratch_buffer_copy();
|
return scratch_buffer_copy();
|
||||||
}
|
}
|
||||||
|
|||||||
11
test/test_suite/struct/missing_anon_access.c3
Normal file
11
test/test_suite/struct/missing_anon_access.c3
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
struct Test
|
||||||
|
{
|
||||||
|
struct { int x; }
|
||||||
|
}
|
||||||
|
|
||||||
|
fn void main()
|
||||||
|
{
|
||||||
|
Test t;
|
||||||
|
Test.membersof[0].get(t).x;
|
||||||
|
Test.membersof[0].get(t).y; // #error: here is no field or method 'Test.(anon).y'
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user