Changeset fe52ab1 in tol


Ignore:
Timestamp:
Mar 23, 2011, 9:34:07 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
b6a9243
Parents:
3a849c8
Message:

Fixes #1133
Struct creator function must be destroyed at user code level

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

File:
1 edited

Legend:

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

    r3a849c8 rfe52ab1  
    3636#include <tol/tol_bsymboltable.h>
    3737#include <tol/tol_bsetgra.h>
     38#include <tol/tol_bcodgra.h>
    3839#include <tol/tol_bnameblock.h>
    3940#include <tol/tol_bclass.h>
    … …  
    318319  if(function_)
    319320  {
    320           function_->DecNRefs();
    321   //VBR: This line is added to catch possible errors during a quarentine period
    322 #   ifndef NDEBUG
    323     if(!System() && !function_->NRefs())
    324     {
    325       Warning(BText("\nStruct creator cannot be destroyed due to it is "
    326               "already referenced ")+function_->NRefs()+ " times\n");
    327     }
    328 #   endif
     321    function_->DecNRefs();
    329322    BGrammar::DelObject(function_);
    330           DESTROY(function_);
     323    BUserFunCode* uCode = function_->GetCode();
     324          DESTROY(uCode);
    331325  }
    332326  BGrammar::DelObject(this);
    … …  
    633627{
    634628    BText dump = "Struct ";
    635     dump += FullName() + " = {";
     629    dump += FullName() + " {\n  ";
    636630    if(field_->HasValue())
    637631    {
    … …  
    640634        for(n=0; n<field_->Size(); n++)
    641635        {
    642             if(arg.HasName()) { arg += ", "; }
     636            if(arg.HasName()) { arg += ", \n"; }
    643637            arg += (*field_)[n].Dump() ;
    644638        }
    645639        dump += arg;
    646640    }
    647     dump += "}";
     641    dump += "\n};";
    648642    return(dump);
    649643}
Note: See TracChangeset for help on using the changeset viewer.