Changeset 349 in dev for trunk/abdev/BasicCompiler32/Compile_Object.cpp
- Timestamp:
- Oct 13, 2007, 11:45:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Object.cpp
r346 r349 97 97 } 98 98 } 99 void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType ){ 100 int typeSize = classObj.GetSize(); 101 102 if(classObj.IsAbstract()){ 99 void Operator_New( const CClass &objClass, const char *objectSizeStr, const char *parameter, const Type &baseType ) 100 { 101 const CClass *pClass = &objClass; 102 int typeSize = pClass->GetSize(); 103 104 if( pClass->IsInterface() ) 105 { 106 pClass = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr(); 107 } 108 109 if(pClass->IsAbstract()){ 103 110 //抽象クラスだったとき 104 SetError(125, classObj.GetName(),cp);111 SetError(125,pClass->GetName(),cp); 105 112 } 106 113 … … 188 195 189 196 190 const CMethod *method = classObj.GetDestructorMethod();197 const CMethod *method = pClass->GetDestructorMethod(); 191 198 if( method == NULL ) return; 192 199 … … 207 214 208 215 //仮想関数テーブルを初期化 209 if( classObj.IsExistVirtualFunctions()210 && ! classObj.IsAbstract() )216 if( pClass->IsExistVirtualFunctions() 217 && !pClass->IsAbstract() ) 211 218 { 212 219 // mov ecx,vtblAddress 213 compiler.codeGenerator.op_mov_RV_vtbl( REG_ECX, &classObj);220 compiler.codeGenerator.op_mov_RV_vtbl( REG_ECX, pClass ); 214 221 215 222 //mov dword ptr[eax],ecx … … 217 224 218 225 // 仮想関数になるメソッドに使用チェックをつける 219 BOOST_FOREACH( const CMethod *pMethod, classObj.GetDynamicMethods() )226 BOOST_FOREACH( const CMethod *pMethod, pClass->GetDynamicMethods() ) 220 227 { 221 228 if( pMethod->IsVirtual() ) … … 224 231 } 225 232 } 226 BOOST_FOREACH( const ::Interface *pInterface, classObj.GetInterfaces() )233 BOOST_FOREACH( const ::Interface *pInterface, pClass->GetInterfaces() ) 227 234 { 228 235 BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ) … … 248 255 //////////////////////////// 249 256 250 _call_constructor( &classObj,parameter,typeSize,bSomeObjects);257 _call_constructor(pClass,parameter,typeSize,bSomeObjects); 251 258 } 252 259 void OpcodeDelete(const char *Parameter, bool isSweeping){
Note:
See TracChangeset
for help on using the changeset viewer.