mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Broken cast from fault to array pointer #2778.
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
- Deprecated use of `?` to create optional.
|
- Deprecated use of `?` to create optional.
|
||||||
- Vectors not converted to arrays when passed as raw vaargs. #2776
|
- Vectors not converted to arrays when passed as raw vaargs. #2776
|
||||||
- Second value in switch range not checked properly, causing an error on non-const values. #2777
|
- Second value in switch range not checked properly, causing an error on non-const values. #2777
|
||||||
|
- Broken cast from fault to array pointer #2778.
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Regression with npot vector in struct triggering an assert #2219.
|
- Regression with npot vector in struct triggering an assert #2219.
|
||||||
|
|||||||
@@ -2609,7 +2609,7 @@ CastFunction cast_function[CONV_LAST + 1][CONV_LAST + 1] = {
|
|||||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // CONST ENUM
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // CONST ENUM
|
||||||
{XX2VO, 0, PT2BO, PT2IN, 0, 0, 0, EX2VC, 0, 0, 0, 0, 0, 0, 0, 0, 0, PT2PT, 0, 0, PT2PT, 0, 0, 0 }, // FUNC
|
{XX2VO, 0, PT2BO, PT2IN, 0, 0, 0, EX2VC, 0, 0, 0, 0, 0, 0, 0, 0, 0, PT2PT, 0, 0, PT2PT, 0, 0, 0 }, // FUNC
|
||||||
{XX2VO, 0, TI2BO, TI2IN, 0, TI2PT, 0, EX2VC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TI2PT, TI2PT, 0, 0 }, // TYPEID
|
{XX2VO, 0, TI2BO, TI2IN, 0, TI2PT, 0, EX2VC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TI2PT, TI2PT, 0, 0 }, // TYPEID
|
||||||
{XX2VO, 0, AF2BO, FA2IN, 0, FA2PT, 0, EX2VC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FA2IN, FA2IN, 0, 0 }, // ANYFAULT
|
{XX2VO, 0, AF2BO, FA2IN, 0, FA2PT, 0, EX2VC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FA2PT, FA2PT, 0, 0 }, // ANYFAULT
|
||||||
{XX2VO, 0, PT2BO, PT2IN, 0, PT2PT, 0, EX2VC, 0, 0, 0, 0, 0, PT2AY, PT2AY, 0, 0, PT2PT, 0, 0, 0, PT2PT, 0, 0 }, // VOIDPTR
|
{XX2VO, 0, PT2BO, PT2IN, 0, PT2PT, 0, EX2VC, 0, 0, 0, 0, 0, PT2AY, PT2AY, 0, 0, PT2PT, 0, 0, 0, PT2PT, 0, 0 }, // VOIDPTR
|
||||||
{XX2VO, 0, PT2BO, PT2IN, 0, PT2PT, AP2SL, EX2VC, 0, 0, 0, 0, 0, PT2AY, PT2AY, 0, 0, 0, 0, 0, PT2PT, PT2PT, PT2FE, 0 }, // ARRAYPTR
|
{XX2VO, 0, PT2BO, PT2IN, 0, PT2PT, AP2SL, EX2VC, 0, 0, 0, 0, 0, PT2AY, PT2AY, 0, 0, 0, 0, 0, PT2PT, PT2PT, PT2FE, 0 }, // ARRAYPTR
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // INFERRED
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // INFERRED
|
||||||
|
|||||||
9
test/test_suite/bitstruct/fault_to_arrptr.c3
Normal file
9
test/test_suite/bitstruct/fault_to_arrptr.c3
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
// #target: linux-x64
|
||||||
|
import libc;
|
||||||
|
fn void a()
|
||||||
|
{
|
||||||
|
fault x = f; // #error: 'f' could not be found
|
||||||
|
ulong z = (ulong); // #error: Implicitly casting 'typeid' to 'ulong' is not permitted
|
||||||
|
z = (Sigset_t*)(x); // #error: Implicitly casting 'Sigset_t*' (ulong[16]*) to 'ulong'
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user