-
- Downloads
py: Use a wrapper to explicitly check self argument of builtin methods.
Previous to this patch a call such as list.append(1, 2) would lead to a seg fault. This is because list.append is a builtin method and the first argument to such methods is always assumed to have the correct type. Now, when a builtin method is extracted like this it is wrapped in a checker object which checks the the type of the first argument before calling the builtin function. This feature is contrelled by MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG and is enabled by default. See issue #1216.
Showing
- bare-arm/mpconfigport.h 1 addition, 0 deletionsbare-arm/mpconfigport.h
- minimal/mpconfigport.h 1 addition, 0 deletionsminimal/mpconfigport.h
- py/mpconfig.h 9 additions, 0 deletionspy/mpconfig.h
- py/runtime.c 57 additions, 3 deletionspy/runtime.c
- tests/basics/class_use_other.py 12 additions, 0 deletionstests/basics/class_use_other.py
- tests/basics/self_type_check.py 31 additions, 0 deletionstests/basics/self_type_check.py
- unix/mpconfigport_minimal.h 1 addition, 0 deletionsunix/mpconfigport_minimal.h
Loading
Please register or sign in to comment