Adding instructions on how to enable LUAI_ASSERT when building Lua, per
PR
@@ -101,3 +101,20 @@ Here are some useful commands for examining the code generated by `pallenec`:
* show pretty-printed Pallene IR: `pallenec --print-ir foo.pln`
* show generated C: `pallenec --emit-c foo.pln`
* show generated ASM: `objdump -d -S foo.so`
+
+# Enabling internal Lua assertion checks
+
+To help detect and debug bugs caused by Pallene incorrectly manipulating the internal Lua state,
+you can recompile Lua to enable its LUAI_ASSERT macro.
+
+Refer back to the orginal instructions to build lua-internals in README.md.
+You can explicitly add the flag to the make instruction: `make MYCFLAGS=-DLUAI_ASSERT=1 linux-readline -j4`
+
+Remember to clean before rebuilding.
+
+```sh
+cd lua-internals
+make clean
+make MYCFLAGS=-DLUAI_ASSERT=1 linux-readline -j4
+sudo make install
+```
