Changeset 8e9626b in tol


Ignore:
Timestamp:
Aug 25, 2015, 9:47:58 AM (11 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
b2fecec
Parents:
33fc49e
Message:

resolviendo situación detectada por valgrind

initializing TOL ==10862== Conditional jump or move depends on
uninitialised value(s)
==10862==    at 0x5941C94: BFixedSizeMemoryHandler::IsAssigned(void
const*, unsigned short) (bfsmem.cpp:602)
==10862==    by 0x5AB6415: BNameBlock::BNameBlock() (nameblock.cpp:138)
==10862==    by 0x5AC17CF:
BGraContensBase<BNameBlock>::InitInstances() (nameblock.cpp:1549)
==10862==    by 0x592DBE6:
BGraContensBase<BNameBlock>::InitGrammar(int, BText const&, BText
const&, BSyntaxObject* (*)(BText const&, BSyntaxObject*),
BSyntaxObject* (*)(BText const&, BSyntaxObject*)) (tol_bgencon.h:135)
==10862==    by 0x58FE04D: InitGrammars(char const*) (init.cpp:847)
==10862==    by 0x5902B62: InitializeFromMainArgs (init.cpp:1601)
==10862==    by 0x400C55: main (tol.cpp:43)

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@6824 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/btol/bgrammar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/nameblock.cpp

    r33fc49e r8e9626b  
    118118  public_  (),
    119119//private_ (),
     120  createdWithNew_(-1),
    120121  evLevel_ (BGrammar::Level()),
    121122  level_   (-999999999),
    … …  
    132133  SetEmptyKey(public_ ,emptyHashKey_);
    133134//SetEmptyKey(private_,emptyHashKey_);
     135#if 0
    134136#if (__USE_POOL__==__POOL_BFSMEM__)
    135137  short isAssigned = BFSMEM_Hndlr->IsAssigned(this,this->GetPageNum());
    … …  
    138140#endif
    139141  createdWithNew_ = isAssigned==1;
     142#endif
    140143}
    141144
    … …  
    146149  public_  (),
    147150//private_ (),
     151  createdWithNew_(-1),
    148152  evLevel_ (BGrammar::Level()),
    149153  level_   (-999999999),
    … …  
    160164  SetEmptyKey(public_ ,emptyHashKey_);
    161165//SetEmptyKey(private_,emptyHashKey_);
     166#if 0
    162167#if (__USE_POOL__==__POOL_BFSMEM__)
    163168  short isAssigned = BFSMEM_Hndlr->IsAssigned(this,this->GetPageNum());
    … …  
    166171#endif
    167172  createdWithNew_ = isAssigned==1;
     173#endif
    168174}
    169175
    … …  
    174180  public_  (),
    175181//private_ (),
     182  createdWithNew_(-1),
    176183  evLevel_ (BGrammar::Level()),
    177184  level_   (-999999999),
    … …  
    188195  SetEmptyKey(public_ ,emptyHashKey_);
    189196//SetEmptyKey(private_,emptyHashKey_);
     197#if 0
    190198#if (__USE_POOL__==__POOL_BFSMEM__)
    191199  short isAssigned = BFSMEM_Hndlr->IsAssigned(this,this->GetPageNum());
    … …  
    194202#endif
    195203  createdWithNew_ = isAssigned!=-1;
     204#endif
    196205  *this = ns;
    197206} 
    … …  
    202211{
    203212  Clean();
     213}
     214
     215int BNameBlock::GetCreatedWithNew()
     216{
     217  if ( this->createdWithNew_ == -1 )
     218    {
     219#if (__USE_POOL__==__POOL_BFSMEM__)
     220    short isAssigned = BFSMEM_Hndlr->IsAssigned(this,this->GetPageNum());
     221#else
     222    short isAssigned = -1;
     223#endif
     224    createdWithNew_ = isAssigned==1;
     225    }
     226  return this->createdWithNew_;
    204227}
    205228
    … …  
    307330{
    308331#if (__USE_POOL__==__POOL_BFSMEM__)
    309   if(createdWithNew_)
     332  if(const_cast<BNameBlock*>(this)->GetCreatedWithNew() /*createdWithNew_*/)
    310333  {
    311334    short isAssigned = BFSMEM_Hndlr->IsAssigned(this,this->GetPageNum());
    … …  
    315338#endif       
    316339  {
    317     return(true);
     340    return( 1 );
    318341  }
    319342}
    … …  
    354377#if (__USE_POOL__==__POOL_BFSMEM__)
    355378  if(current_ &&
    356      current_->createdWithNew_ &&
     379     const_cast<BNameBlock*>(current_)->GetCreatedWithNew() /*current_->createdWithNew_*/ &&
    357380     !(BFSMEM_Hndlr->IsAssigned(current_,current_->GetPageNum())))
    358381  {
    … …  
    379402#if (__USE_POOL__==__POOL_BFSMEM__)
    380403  if(building_ &&
    381      building_->Contens().createdWithNew_ &&
     404     building_->Contens().GetCreatedWithNew() /*.createdWithNew_*/ &&
    382405     !(BFSMEM_Hndlr->IsAssigned(&building_->Contens(),
    383406                                building_->Contens().GetPageNum())))
  • tol/btol/bgrammar/tol_bnameblock.h

    r33fc49e r8e9626b  
    8383  BRequiredPackage* requiredPackages_;
    8484  BText localName_;
    85   bool createdWithNew_;
     85  int createdWithNew_;
    8686  int evLevel_;
    8787  int level_;
    8888  int nonPrivateMembers_;
    8989  bool doingRebuildFullNameDeep;
     90
     91  int GetCreatedWithNew();
    9092public:
    9193  bool startedPackage;
Note: See TracChangeset for help on using the changeset viewer.