Skip to content

Commit 24475b1

Browse files
committed
check arguments given to '@disable'
1 parent e115ce3 commit 24475b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tools/clinic/libclinic/dsl_parser.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,12 @@ def at_disable(self, *args: str) -> None:
430430
fail("Can't set @disable, function is not a normal callable")
431431
if not args:
432432
fail("@disable expects at least one argument")
433-
self.disable_fastcall = 'fastcall' in args
433+
features = list(args)
434+
if 'fastcall' in features:
435+
features.remove('fastcall')
436+
self.disable_fastcall = True
437+
if features:
438+
fail("invalid argument for @disable:", features[0])
434439

435440
def at_getter(self) -> None:
436441
match self.kind:

0 commit comments

Comments
 (0)