Strange problem with the interpreter

From: Pierre-Luc Drouin <pldrouin_at_physics.carleton.ca>
Date: Wed, 26 Oct 2005 17:44:42 -0400


It looks like I have found a strange problem with the interpreter. Here are 3 script files where I initialize a TString or a TString array in different locations. The third script file makes root to crash:

First script file, initialization of a TString outside the test function
//////////////////////////////////////////////////////////
void test();

TString a="test";

void test()
{
  cout << a.Data() << endl;
}
//////////////////////////////////////////////////////////

Output from root:
root [0] .x test.C
test
root [1] .q

Second script file, initialization of a TString array inside the test2 function
//////////////////////////////////////////////////////////
void test2();

void test2()
{
  TString a[2]={"test","test"};
  cout << a[0].Data() << endl;
}
//////////////////////////////////////////////////////////

Output from root:
root [0] .x test2.C
test
root [1] .q

Thirs script file, initialization of a TString array outside the test3 functon
//////////////////////////////////////////////////////////
void test3();

TString a[2]={"test","test"};

void test3()
{
  cout << a[0].Data() << endl;
}
//////////////////////////////////////////////////////////

Output from root:
root [0] .x test3.C
root [1] .q

So it looks like that the TString array is not initialized outside the function or that it is not initialized correctly. I get this error with both 4.04/02f running on Linux 2.4.20 and 5.05/01 running on FreeBSD Received on Wed Oct 26 2005 - 23:44:58 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET