gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/avm2 r9558: Initialize Class traits to 0.


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9558: Initialize Class traits to 0.
Date: Fri, 12 Sep 2008 03:04:58 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9558
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Fri 2008-09-12 03:04:58 +0800
message:
  Initialize Class traits to 0.
modified:
  libcore/parser/abc_block.cpp
=== modified file 'libcore/parser/abc_block.cpp'
--- a/libcore/parser/abc_block.cpp      2008-09-02 02:19:58 +0000
+++ b/libcore/parser/abc_block.cpp      2008-09-11 19:04:58 +0000
@@ -60,16 +60,13 @@
                        return false;
                }
                // The name has been validated in read.
-               if (mHasValue){
-                       LOG_DEBUG_ABC("Adding property=%s with value=%s 
slot=%u",pBlock->mStringPool[mName],mValue.toDebugString(),mSlotId);
-                       pClass->addValue(mGlobalName, mNamespace, mSlotId, 
pType, 
-                               mValue, mKind == KIND_CONST, do_static);
-                       }
-               else{
-                       LOG_DEBUG_ABC("Adding property=%s 
slot=%u",pBlock->mStringPool[mName],mSlotId);
-                       pClass->addSlot(mGlobalName, mNamespace, mSlotId, pType,
-                               do_static);
-                       }
+               // TODO: Find a better way to initialize trait values.
+               if (!mHasValue){
+                       mValue = as_value(0);
+               }
+               LOG_DEBUG_ABC("Adding property=%s with value=%s 
slot=%u",pBlock->mStringPool[mName],mValue.toDebugString(),mSlotId);
+               pClass->addValue(mGlobalName, mNamespace, mSlotId, pType, 
+                       mValue, mKind == KIND_CONST, do_static);
                break;
        }
        case KIND_METHOD:
@@ -209,6 +206,7 @@
                mSlotId = in->read_V32();
                mTypeIndex = in->read_V32();
                boost::uint32_t vindex = in->read_V32();
+               LOG_DEBUG_ABC("Slot ID=%u Type=%s Pool 
index=%u",mSlotId,pBlock->mStringPool[pBlock->mMultinamePool[mTypeIndex].getABCName()],vindex);
                if (vindex)
                {
                        if (!pBlock->pool_value(vindex, in->read_u8(), mValue))
@@ -618,6 +616,7 @@
        if (!index)
                return true;
 
+       LOG_DEBUG_ABC("Pool value: index is %u type is 0x%X",index,type | 0x0);
        switch (type)
        {
        case POOL_STRING: 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]