On Okt 19 2023, David Malcolm wrote: > +void > +region_model:: > +check_one_function_attr_null_terminated_string_arg (const gcall *call, > + tree callee_fndecl, > + region_model_context *ctxt, > + rdwr_map &rdwr_idx, > + tree attr) > +{ > + gcc_assert (call); > + gcc_assert (callee_fndecl); > + gcc_assert (ctxt); > + gcc_assert (attr); > + > + tree arg = TREE_VALUE (attr); > + if (!arg) > + return; > + > + /* Convert from 1-based to 0-based index. */ > + unsigned int arg_idx = TREE_INT_CST_LOW (TREE_VALUE (arg)) - 1; > + > + /* If there's also an "access" attribute on the ptr param > + for reading with a size param specified, then that size > + limits the size of the possible read from the pointer. */ > + if (const attr_access* access = rdwr_idx.get (arg_idx)) > + if ((access->mode == access_read_only > + || access->mode == access_read_write) > + && access->sizarg != UINT_MAX) > + { > + /* First, check for a null-terminated string *without* > + emitting emitting warnings (via a null context), to
-emitting -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."