micropython/py
Jeff Epler 95e43efc99 py/objfloat: Fix undefined integer behavior hashing negative zero.
Under ubsan, when evaluating hash(-0.) the following diagnostic occurs:

    ../../py/objfloat.c:102:15: runtime error: negation of
    -9223372036854775808 cannot be represented in type 'mp_int_t' (aka
    'long'); cast to an unsigned type to negate this value to itself

So do just that, to tell the compiler that we want to perform this
operation using modulo arithmetic rules.
2018-05-21 12:49:56 +10:00
..
argcheck.c py/argcheck: Remove #if guard around terse error message helper func. 2017-10-19 18:57:26 +11:00
asmarm.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmarm.h py/emitnative: Clean up asm macro names so they have dest as first arg. 2017-11-15 11:46:49 +11:00
asmbase.c py/asmbase: Revert removal of clearing of label offsets for native emit. 2017-12-08 19:07:00 +11:00
asmbase.h
asmthumb.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmthumb.h py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
asmx64.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmx64.h py/emitnative: Clean up asm macro names so they have dest as first arg. 2017-11-15 11:46:49 +11:00
asmx86.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmx86.h py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmxtensa.c
asmxtensa.h py/emitnative: Clean up asm macro names so they have dest as first arg. 2017-11-15 11:46:49 +11:00
bc.c py/bc: Update opcode_format_table to match the bytecode. 2017-10-10 10:37:38 +11:00
bc.h all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
bc0.h py: Clean up unary and binary enum list to keep groups together. 2017-10-05 10:49:44 +11:00
binary.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
binary.h
builtin.h
builtinevex.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
builtinhelp.c py/builtinhelp: Change occurrence of mp_uint_t to size_t. 2018-05-02 16:50:28 +10:00
builtinimport.c py/builtinimport: Add compile-time option to disable external imports. 2018-02-20 18:00:44 +11:00
compile.c py/compile: Change comment about ITER_BUF_NSLOTS to a static assertion. 2018-05-18 23:31:00 +10:00
compile.h
emit.h all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
emitbc.c py/emitbc: Avoid undefined behavior calling memset() with NULL 1st arg. 2018-05-21 12:04:20 +10:00
emitcommon.c
emitglue.c py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
emitglue.h py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
emitinlinethumb.c
emitinlinextensa.c
emitnarm.c py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
emitnative.c py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
emitnthumb.c py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
emitnx64.c py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
emitnx86.c py/emitnx86: Fix 32-bit x86 native emitter build by including header. 2018-05-04 20:39:16 +10:00
emitnxtensa.c py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
formatfloat.c py/formatfloat: Fix case where floats could render with negative digits. 2018-03-01 17:00:02 +11:00
formatfloat.h
frozenmod.c
frozenmod.h
gc.c py/mpstate.h: Adjust start of root pointer section to exclude non-ptrs. 2018-05-13 22:53:28 +10:00
gc.h
grammar.h
lexer.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
lexer.h
makeqstrdata.py py/modbuiltins: Make built-in dir support the __dir__ special method. 2018-05-10 23:14:23 +10:00
makeqstrdefs.py py/makeqstrdefs.py: Optimise by using compiled re's so it runs faster. 2018-03-16 23:54:06 +11:00
makeversionhdr.py py: Use "GEN" consistently for describing files generated in the build. 2018-02-22 12:48:51 +11:00
malloc.c py/malloc: Remove unneeded code checking m_malloc return value. 2017-12-20 16:55:42 +11:00
map.c py/map: Don't include ordered-dict mutating code when not needed. 2017-12-19 13:37:15 +11:00
misc.h py/misc.h: Add MP_STATIC_ASSERT macro to do static assertions. 2018-05-18 23:31:00 +10:00
mkenv.mk py/mkenv.mk: Use $(PYTHON) consistently when calling Python tools. 2017-11-15 11:56:58 +11:00
mkrules.mk py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
modarray.c
modbuiltins.c py/modbuiltins: Make built-in dir support the __dir__ special method. 2018-05-10 23:14:23 +10:00
modcmath.c
modcollections.c py/objdeque: Implement ucollections.deque type with fixed size. 2018-02-21 22:39:25 +11:00
modgc.c
modio.c py/modio: Use correct config macro to enable resource_stream function. 2017-12-19 16:59:08 +11:00
modmath.c py/modmath: Convert log2 macro into a function. 2017-10-10 16:01:04 +11:00
modmicropython.c py: Don't include mp_optimise_value or opt_level() if compiler disabled. 2018-04-04 14:24:03 +10:00
modstruct.c
modsys.c py/modsys: Don't compile getsizeof function if feature is disabled. 2018-04-04 14:23:25 +10:00
modthread.c py: Introduce a Python stack for scoped allocation. 2017-12-11 13:49:09 +11:00
moduerrno.c
mpconfig.h py/mpconfig.h: Be stricter when autodetecting machine endianness. 2018-05-11 21:51:34 +10:00
mperrno.h py/mperrno: Define MP_EWOULDBLOCK as EWOULDBLOCK, not EAGAIN. 2018-05-01 15:53:25 +10:00
mphal.h
mpprint.c py/mpprint: Fix "%x" vs "%X" regression introduced in previous commit. 2017-12-07 10:31:14 +02:00
mpprint.h
mpstate.c
mpstate.h py/mpstate.h: Adjust start of root pointer section to exclude non-ptrs. 2018-05-13 22:53:28 +10:00
mpthread.h
mpz.c py/mpz: Avoid undefined behavior at integer overflow in mpz_hash. 2018-05-21 12:48:26 +10:00
mpz.h py/mpz: Simplify handling of borrow and quo adjustment in mpn_div. 2017-12-29 14:05:48 +11:00
nativeglue.c py/emitnative: Implement floor-division and modulo for viper emitter. 2017-10-11 18:54:34 +11:00
nlr.c py/nlr: Fix missing trailing characters in comments in nlr.c 2017-12-29 22:24:53 +11:00
nlr.h py/nlr: Fix nlr functions for 64bit ports built with gcc on Windows 2017-12-29 22:24:46 +11:00
nlrsetjmp.c py/nlr: Factor out common NLR code to macro and generic funcs in nlr.c. 2017-12-28 16:46:30 +11:00
nlrthumb.c py/nlrthumb: Fix Clang support wrt use of "return 0". 2018-04-27 15:10:42 +10:00
nlrx64.c py/nlr: Fix nlr functions for 64bit ports built with gcc on Windows 2017-12-29 22:24:46 +11:00
nlrx86.c py/nlrx86: Use naked attribute on nlr_push for gcc 8.0 and higher. 2018-05-15 11:17:28 +10:00
nlrxtensa.c py/nlr: Factor out common NLR code to macro and generic funcs in nlr.c. 2017-12-28 16:46:30 +11:00
obj.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
obj.h py/obj.h: Fix math.e constant for nan-boxing builds. 2018-05-01 23:25:18 +10:00
objarray.c py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN. 2017-11-24 14:48:23 +11:00
objarray.h
objattrtuple.c
objbool.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objboundmeth.c py: Convert all uses of alloca() to use new scoped allocation API. 2017-12-11 13:49:09 +11:00
objcell.c
objclosure.c
objcomplex.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objdeque.c py/objdeque: Fix sign extension bug when computing len of deque object. 2018-05-11 13:44:50 +10:00
objdict.c py/objdict: Disallow possible modifications to fixed dicts. 2018-02-18 21:51:04 -06:00
objenumerate.c
objexcept.c py/objexcept: Make MP_DEFINE_EXCEPTION public so ports can define excs. 2018-03-17 00:31:40 +11:00
objexcept.h py/objexcept: Make MP_DEFINE_EXCEPTION public so ports can define excs. 2018-03-17 00:31:40 +11:00
objfilter.c
objfloat.c py/objfloat: Fix undefined integer behavior hashing negative zero. 2018-05-21 12:49:56 +10:00
objfun.c py/objfun: Fix variable name in DECODE_CODESTATE_SIZE() macro. 2018-05-17 11:20:06 +10:00
objfun.h
objgenerator.c py/objgenerator: Check stack before resuming a generator. 2018-04-10 14:06:26 +10:00
objgenerator.h
objgetitemiter.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objint.c py/objint: Remove unreachable code checking for int type in format func. 2018-03-02 11:01:24 +11:00
objint.h
objint_longlong.c py/objint: Simplify LHS arg type checking in int binary op functions. 2018-04-05 01:11:26 +10:00
objint_mpz.c py/objint: Simplify LHS arg type checking in int binary op functions. 2018-04-05 01:11:26 +10:00
objlist.c all: Use NULL instead of "" when calling mp_raise exception helpers. 2017-10-24 22:39:36 +11:00
objlist.h py/obj.h: Move declaration of mp_obj_list_init to objlist.h. 2018-03-13 14:03:15 +11:00
objmap.c
objmodule.c py/objmodule: Factor common code for calling __init__ on builtin module. 2018-02-20 17:56:58 +11:00
objmodule.h py/objmodule: Factor common code for calling __init__ on builtin module. 2018-02-20 17:56:58 +11:00
objnamedtuple.c py/objnamedtuple: Allow to reuse namedtuple basic functionality. 2017-11-20 09:30:06 +02:00
objnamedtuple.h py/objnamedtuple: Allow to reuse namedtuple basic functionality. 2017-11-20 09:30:06 +02:00
objnone.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objobject.c py/objtype: Refactor object's handling of __new__ to not create 2 objs. 2017-12-12 16:53:44 +11:00
objpolyiter.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objproperty.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objrange.c py/objrange: Implement (in)equality comparison between range objects. 2018-02-14 23:17:06 +11:00
objreversed.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objset.c py/objset: Remove unneeded check from set_equal. 2017-12-19 14:01:19 +11:00
objsingleton.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objslice.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objstr.c py/objstr: In find/rfind, don't crash when end < start. 2018-04-05 16:14:17 +10:00
objstr.h py/objstr: Make mp_obj_new_str_of_type check for existing interned qstr. 2017-11-16 13:53:04 +11:00
objstringio.c py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
objstringio.h
objstrunicode.c py/unicode: Clean up utf8 funcs and provide non-utf8 inline versions. 2018-02-14 18:19:22 +11:00
objtuple.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
objtuple.h
objtype.c py/objtype: Check and prevent delete/store on a fixed locals map. 2018-02-07 15:44:29 +11:00
objtype.h py/objtype: Refactor object's handling of __new__ to not create 2 objs. 2017-12-12 16:53:44 +11:00
objzip.c
opmethods.c py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN. 2017-11-24 14:48:23 +11:00
parse.c py/parse: Fix macro evaluation by avoiding empty __VA_ARGS__. 2017-12-29 13:44:26 +11:00
parse.h
parsenum.c py/parsenum: Avoid undefined behavior parsing floats with large exponents. 2018-05-21 12:37:57 +10:00
parsenum.h
parsenumbase.c
parsenumbase.h
persistentcode.c py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
persistentcode.h
py.mk py: Refactor how native emitter code is compiled with a file per arch. 2018-04-10 15:06:47 +10:00
pystack.c py/pystack: Use "pystack exhausted" as error msg for out of pystack mem. 2018-02-19 00:26:14 +11:00
pystack.h py: Introduce a Python stack for scoped allocation. 2017-12-11 13:49:09 +11:00
qstr.c py/qstr: Rewrite find_qstr to make manifest that it returns a valid ptr. 2017-11-29 17:01:39 +11:00
qstr.h py/qstr: Add QSTR_TOTAL() macro to get number of qstrs. 2018-02-19 16:12:44 +11:00
qstrdefs.h py/pystack: Use "pystack exhausted" as error msg for out of pystack mem. 2018-02-19 00:26:14 +11:00
reader.c
reader.h
repl.c py/repl: Fix handling of unmatched brackets and unfinished quotes. 2018-05-18 15:23:02 +10:00
repl.h
ringbuf.h
runtime.c py/runtime: Add mp_load_method_protected helper which catches exceptions 2018-05-10 23:00:04 +10:00
runtime.h py/runtime: Add mp_load_method_protected helper which catches exceptions 2018-05-10 23:00:04 +10:00
runtime0.h py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN. 2017-11-24 14:48:23 +11:00
runtime_utils.c py: mp_call_function_*_protected(): Pass-thru return value if possible. 2017-12-05 00:38:41 +02:00
scheduler.c
scope.c
scope.h
sequence.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
showbc.c py: Clean up unary and binary enum list to keep groups together. 2017-10-05 10:49:44 +11:00
smallint.c
smallint.h py: Extend nan-boxing config to have 47-bit small integers. 2017-12-11 22:39:12 +11:00
stackctrl.c py/runtime: Move mp_exc_recursion_depth to runtime and rename to raise. 2017-12-11 13:49:09 +11:00
stackctrl.h
stream.c py/stream: Use uPy errno instead of system's for non-blocking check. 2018-05-01 15:54:50 +10:00
stream.h py/stream: Use uPy errno instead of system's for non-blocking check. 2018-05-01 15:54:50 +10:00
unicode.c py/unicode: Clean up utf8 funcs and provide non-utf8 inline versions. 2018-02-14 18:19:22 +11:00
unicode.h
vm.c py/vm: Improve performance of opcode dispatch when using switch stmt. 2018-05-18 11:47:03 +10:00
vmentrytable.h py: Clean up unary and binary enum list to keep groups together. 2017-10-05 10:49:44 +11:00
vstr.c
warning.c