summaryrefslogtreecommitdiff
path: root/py/showbc.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-18 23:24:36 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-18 23:24:36 +0000
commit08335004cfe95048ee06134a3e49b9fb75639139 (patch)
tree7518a854012938fd70c57b3571a630a142b84f28 /py/showbc.c
parentaefe79880f8c5f66132673ccc9be27d2ca29005b (diff)
Add source file name and line number to error messages.
Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
Diffstat (limited to 'py/showbc.c')
-rw-r--r--py/showbc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/showbc.c b/py/showbc.c
index 36393ce0c..ba7c309b3 100644
--- a/py/showbc.c
+++ b/py/showbc.c
@@ -18,6 +18,10 @@
void mp_show_byte_code(const byte *ip, int len) {
const byte *ip_start = ip;
+ // get code info size
+ machine_uint_t code_info_size = ip[0] | (ip[1] << 8) | (ip[2] << 16) | (ip[3] << 24);
+ ip += code_info_size;
+
// decode prelude
{
uint n_local = *ip++;