eo: Fix bad addressing in _eo_classes array
authorAvi Levin <avi.levin@samsung.com>
Thu, 8 Jan 2015 12:40:56 +0000 (14:40 +0200)
committerTom Hacohen <tom@stosb.com>
Thu, 8 Jan 2015 14:29:07 +0000 (14:29 +0000)
The header.id was masked before using it as index in the _eo_classes
array and was not unmasked when used.
It hasn't caused segfault (by sheer luck) but was wrong.

@fix

src/lib/eo/eo.c

index cc1f8b9..1ee50fe 100644 (file)
@@ -1446,7 +1446,7 @@ eo_class_new(const Eo_Class_Description *desc, const Eo_Class *parent_id, ...)
            memset(tmp, 0, arrsize);
 
         _eo_classes = tmp;
-        _eo_classes[klass->header.id - 1] = klass;
+        _eo_classes[_UNMASK_ID(klass->header.id) - 1] = klass;
      }
    eina_spinlock_release(&_eo_class_creation_lock);