[PATCH 6/6] Make aop_map 'static'

Tom Tromey tom@tromey.com
Tue Jun 20 17:12:00 GMT 2023


>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

John> Looking around in ax-general.c more, it seems we already do runtime
John> validation of potential indices before indexing the array, so I'm not sure
John> the assertion adds much value and I'd be tempted to remove aop_last entirely.

Yeah, that was my feeling as well.  I've changed this patch to just make
aop_map static, and split out another patch to remove aop_last.

John> BTW, the various other places in ax-general.c that do the assertion are
John> all using the expanded form of ARRAY_SIZE and would be a bit more readable
John> perhaps if they used ARRAY_SIZE instead.

I tacked on a patch to do this.  This caught a bug, one of the checks
was using '>' rather than '>='.

Tom


More information about the Gdb-patches mailing list