Commit c3e72a8c authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

mp_obj_is_callable(): Only object types can be callable.

Fixes segfault on callable("string").
parent bc5b3f8c
......@@ -66,7 +66,7 @@ void mp_obj_print_exception(mp_obj_t exc) {
}
bool mp_obj_is_callable(mp_obj_t o_in) {
if (MP_OBJ_IS_SMALL_INT(o_in)) {
if (!MP_OBJ_IS_OBJ(o_in)) {
return false;
} else {
mp_obj_base_t *o = o_in;
......
import sys
print(callable(1))
print(callable("dfsd"))
print(callable(callable))
print(callable(sys))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment