From: Mark Wooding Date: Sun, 20 Oct 2019 18:24:37 +0000 (+0100) Subject: pyke/pyke.c: Check conversions hidden inside `KWLIST' and `KWMETH'. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/pyke/commitdiff_plain/dce47d5020064fb1fc0c58db165d72c7ffd10835?hp=dce47d5020064fb1fc0c58db165d72c7ffd10835 pyke/pyke.c: Check conversions hidden inside `KWLIST' and `KWMETH'. Introduce a new macro `CONVERT_CAREFULLY' which checks (via a rather sleazy hack) that its operand is of the expected type before converting it to some other type. This is protected by an `#ifdef' guard because I'm thinking about adding it to a version of mLib, but I want to keep the Pyke core independent of mLib. Use this new macro to build better versions of `KWLIST' and `KWMETH', which have casts hidden inside them, so that we can now be certain that the method table entries match up with the functions. (Spoiler: they didn't, quite, and commit 19bff42f99d41cd9b8953ff61edfe35380b54d88, backported onto the 1.1.x branch, fixes the bug that was found by this change.) ---