summaryrefslogtreecommitdiffstatshomepage
path: root/py/parsenum.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2018-05-19 10:52:43 -0500
committerDamien George <damien.p.george@gmail.com>2018-05-21 12:04:20 +1000
commitbc6c0b28bf830a75c817fb498b713779c92b731b (patch)
tree3b2131da1877af80b30c82bc9d0ab8b28e1b59f0 /py/parsenum.c
parentafd0701bf7a9dcb50c5ab46b0ae88b303fec6ed3 (diff)
downloadmicropython-bc6c0b28bf830a75c817fb498b713779c92b731b.tar.gz
micropython-bc6c0b28bf830a75c817fb498b713779c92b731b.zip
py/emitbc: Avoid undefined behavior calling memset() with NULL 1st arg.
Calling memset(NULL, value, 0) is not standards compliant so we must add an explicit check that emit->label_offsets is indeed not NULL before calling memset (this pointer will be NULL on the first pass of the parse tree and it's more logical / safer to check this pointer rather than check that the pass is not the first one). Code sanitizers will warn if NULL is passed as the first value to memset, and compilers may optimise the code based on the knowledge that any pointer passed to memset is guaranteed not to be NULL.
Diffstat (limited to 'py/parsenum.c')
0 files changed, 0 insertions, 0 deletions