[all-commits] [llvm/llvm-project] cfcff7: [lldb] Validate a scripted class abstract methods ...
Med Ismail Bennani via All-commits
all-commits at lists.llvm.org
Wed Sep 23 13:33:07 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: cfcff78a126040c7757b3343e028a73fc4a17c83
https://github.com/llvm/llvm-project/commit/cfcff78a126040c7757b3343e028a73fc4a17c83
Author: Med Ismail Bennani <ismail at bennani.ma>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
M lldb/test/API/functionalities/scripted_extensions/malformed_scripted_extensions.py
Log Message:
-----------
[lldb] Validate a scripted class abstract methods before running its constructor (#225246)
`CreatePluginObject` called the class's `__init__` and only then checked
that the class implements the methods the interface requires. So a class
we were always going to reject had already executed arbitrary user code,
side effects included, and if `__init__` happened to raise as well, the
constructor's exception masked the real, structural problem.
Lift the abstract-method diagnosis into `CheckAbstractMethods` and run
it against the class object before calling it. The check already
operated on a class rather than an instance (it just happened to reach
it through `instance.__class__`) so nothing about it needed to change.
The pre-existing-object path (`script_obj`) has no constructor to guard,
so it keeps validating after the fact, gated on a flag so the check runs
once.
`ExceptionInitScriptedBreakpointResolver` in the test fixtures claimed
to test a raising `__init__` but also omitted `__callback__`, so it was
only reporting the init exception because construction used to come
first. It now implements `__callback__`, leaving `__init__` as the
single thing wrong with it, which is what the test means to exercise.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list