Grammar-based fuzzer findings, continuing from #3892. Built from 5c734c4d6 with -DDAS_NO_ASSERTIONS=0 — CMakeCommon.txt defines DAS_NO_ASSERTIONS for Release, MinSizeRel and RelWithDebInfo, so a stock Release build never reaches these.
1. Oversized type as a function return type is not diagnosed, asserts in getStride
[export]
def f => <- tuple<int[2000000000]>(uninitialized)
[export]
def main { }
$ daslang t.das
assertion failed: stride <= 0x7fffffff, src/ast/ast_typedecl.cpp:3506
stride too big 8000000000
The same type as a local is diagnosed properly — var t = tuple<int[2000000000]>(uninitialized) gives error[30508] — so the check exists but does not cover a function return type. Related to #3892 (comment 8), which reaches getSizeOf at ast_typedecl.cpp:3486 through default<T>: same missing check, different entry point and different assertion.
2. Two chained vector conversions on Point3 emit an ambiguous cvt_pass
require UnitTest
[export]
def main {
var v = getSamplePoint3() |> uint3 |> int3
}
$ daslang -aot t.das t.cpp
t.cpp:79:30: error: call to 'cvt_pass' is ambiguous
79 | int3 __v_rename_at_5_0 = cvt_pass(cvt_uint3(das_alias<Point3>::from(getSamplePoint3())));
| ^~~~~~~~
include/daScript/simulate/aot.h:4506:25: note: candidate function
4506 | __forceinline vec4f cvt_pass ( int2 i ) { return i; }
Two conversions are required — a single |> uint3 compiles. int3(1,2,3) in place of getSamplePoint3() compiles, so the das_alias<Point3> wrapper is what makes the overload set ambiguous.
Grammar-based fuzzer findings, continuing from #3892. Built from
5c734c4d6with-DDAS_NO_ASSERTIONS=0—CMakeCommon.txtdefinesDAS_NO_ASSERTIONSfor Release, MinSizeRel and RelWithDebInfo, so a stock Release build never reaches these.1. Oversized type as a function return type is not diagnosed, asserts in
getStrideThe same type as a local is diagnosed properly —
var t = tuple<int[2000000000]>(uninitialized)giveserror[30508]— so the check exists but does not cover a function return type. Related to #3892 (comment 8), which reachesgetSizeOfatast_typedecl.cpp:3486throughdefault<T>: same missing check, different entry point and different assertion.2. Two chained vector conversions on
Point3emit an ambiguouscvt_passTwo conversions are required — a single
|> uint3compiles.int3(1,2,3)in place ofgetSamplePoint3()compiles, so thedas_alias<Point3>wrapper is what makes the overload set ambiguous.