tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.74k stars 770 forks source link

Replace test with invalid-enum-load #2546

Closed rascani closed 2 months ago

rascani commented 2 months ago

The TestTypeSizeOf was casting an invalid value for TfLiteType into a variable of that type. This is undefined behavior and triggered ubsan. This PR replaces this test case with using kTfLiteNoType, which will still trigger the default failure case for TfLiteTypeSizeOf.

BUG=b/333708102