[svn:parrot] r49435 - trunk/src

plobsing at svn.parrot.org plobsing at svn.parrot.org
Mon Oct 4 04:01:54 UTC 2010


Author: plobsing
Date: Mon Oct  4 04:01:54 2010
New Revision: 49435
URL: https://trac.parrot.org/parrot/changeset/49435

Log:
add some sanity and sanity checking to Parrot_Sub_get_line_from_pc

Modified:
   trunk/src/sub.c

Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c	Mon Oct  4 03:41:35 2010	(r49434)
+++ trunk/src/sub.c	Mon Oct  4 04:01:54 2010	(r49435)
@@ -234,8 +234,11 @@
     base_pc            = sub->seg->base.data;
     current_annotation = pc - base_pc;
 
+    /* assert pc is in correct segment */
+    PARROT_ASSERT( base_pc <= pc && pc <= base_pc + sub->seg->base.size );
+
     for (i = op = 0; op < debug_size; ++i) {
-        op_info_t * const op_info  = interp->code->op_info_table[*base_pc];
+        op_info_t * const op_info  = sub->seg->op_info_table[*base_pc];
         opcode_t          var_args = 0;
 
         if (i >= debug_size)


More information about the parrot-commits mailing list