GSoC Project | Basic Support for Trace Compass
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Aug 6 17:32:25 UTC 2019
----- Am 6. Aug 2019 um 17:30 schrieb Ravindra Kumar Meena rmeena840 at gmail.com:
>>
>> > I think this can be the right way to check bound access.
>> >
>> https://github.com/rmeena840/rtems-tools/commit/81bf2a9b9e57e7911d519c4719c5126e29a7adbe
>>
>> No, the API classes are 1, 2, and 3. The indices into the table must be
>> 0, 1, and 2. Don't add asserts in this path. Ignore items which have
>> unexpected values.
>>
> Okay API is always returned in the range [ 1, 3 ]. Decrementing it by one
> should be safe then.
> https://github.com/rmeena840/rtems-tools/commit/8ff97b38970595f507e23f2a9a6e397ae1f70bb9
The converter program should not exhibit undefined behaviour due to invalid input. Lets suppose item->data is zero, what happens then?
Another issue is that your code violates the DRY principle:
https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
More information about the devel
mailing list