Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,13 @@ class ScriptedPythonInterface : virtual public ScriptedInterface {
// This addresses the cases where the embedded interpreter session
// dictionary is passed to the extension initializer which is not used
// most of the time.
// Note, though none of our API's suggest defining the interfaces with
// varargs, we have some extant clients that were doing that. To keep
// from breaking them, we just say putting a varargs in these signatures
// turns off argument checking.
size_t num_args = sizeof...(Args);
if (num_args != arg_info->max_positional_args) {
if (arg_info->max_positional_args != PythonCallable::ArgInfo::UNBOUNDED &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to discourage this pattern, we could emit a warning with Debugger::ReportWarning. It takes an optional once_flag that would allow us to limit this warning to once per ScriptedPythonInterface instance or even once per lldb instance if we made it static.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's necessary. Someone did this once and then sadly that got copied around and so there are a few versions I need to maintain support for. I'm not sure this is something anyone else is likely to think is a good idea.

num_args != arg_info->max_positional_args) {
if (num_args != arg_info->max_positional_args - 1)
return create_error("Passed arguments ({0}) doesn't match the number "
"of expected arguments ({1}).",
Expand Down
Loading