Author: allison
Date: Thu Oct  4 16:17:20 2007
New Revision: 21854

Modified:
   branches/pdd15oo/src/oo.c

Log:
[pdd15oo] Make sure class lookup returns PMCNULL for all type numbers PMCProxy 
would reject.


Modified: branches/pdd15oo/src/oo.c
==============================================================================
--- branches/pdd15oo/src/oo.c   (original)
+++ branches/pdd15oo/src/oo.c   Thu Oct  4 16:17:20 2007
@@ -146,7 +146,11 @@
     if (PMC_IS_NULL(classobj)) {
         /* Look up a low-level class and create a proxy */
         INTVAL type = pmc_type(interp, VTABLE_get_string(interp, key));
-        if (type) {
+        /* Reject invalid type numbers */
+        if (type > interp->n_vtable_max || type < 0) {
+            return PMCNULL;
+        }
+        else {
              PMC *type_num = pmc_new(interp, enum_class_Integer);
              VTABLE_set_integer_native(interp, type_num, type);
              classobj = pmc_new_init(interp, enum_class_PMCProxy, type_num);

Reply via email to