zero ptr deleted in smart-pointer template. (g++-2.8.1)
Yotam Medini
yotam@avanticorp.com
Tue Oct 6 14:57:00 GMT 1998
Hello g++ developers:
Small but non trivial example. It involves manual instantiation
of smart-pointer template.
By uudecode-ing and running make with the appropriate GCCROOT=
you should get more or less the following:
------------------------------------------------------------------------
rm -rf tst
mkdir tst
(cd tst; uudecode ../enc; gzip -cd sp.tar.gz | tar xf -; ls -l)
total 9
-rw-r--r-- 1 yotam products 184 Oct 6 09:57 D.hh
-rw-r--r-- 1 yotam products 649 Oct 6 10:16 Makefile
-rw-r--r-- 1 yotam products 584 Oct 6 09:57 WbPointer.cc
-rw-r--r-- 1 yotam products 1327 Oct 6 09:57 WbPointer.hh
-rw-r--r-- 1 yotam products 214 Oct 6 09:57 sp.cc
-rw-r--r-- 1 yotam products 1376 Oct 6 10:16 sp.tar.gz
-rw-r--r-- 1 yotam products 71 Oct 6 09:57 tpl.cc
make -C tst
make[1]: Entering directory `/home/yotam/work/depict/front/tdf/SP/tst'
/site/seg/gcc-2.8.1/bin/g++ -c -g sp.cc
/site/seg/gcc-2.8.1/bin/g++ -c -g tpl.cc
rm -f sp sp.new
/site/seg/gcc-2.8.1/bin/g++ -g -Wl,-R/site/seg/gcc-2.8.1/lib -o sp.new sp.o tpl.o 2>&1 | \
tee link.err | /site/seg/gcc-2.8.1/bin/c++filt
mv sp.new sp
make[1]: Leaving directory `/home/yotam/work/depict/front/tdf/SP/tst'
tst/sp
Hello
make: *** [test-enc] Segmentation Fault
------------------------------------------------------------------------
A pointer member of template class is zero.
But for some mysterious reason, a 'delete' on it results
in actual call to a member function with a bad this-pointer.
Putting all the template source together and eliminating
the manual instantiation removes the problem.
-- yotam
------------------------------------------------------------------------
begin 644 sp.tar.gz
M'XL(`%Q0&C8``^T9:T_C1I"O[*^8`H=B<G;B`*&*0W1'PAVTO`17<94J18F]
M25P<VUT[M`?'_?;.>KWQ([FFJBY!Y3Q"\>[,[,[LC.>Q)O`UTUQ;+NC5:GUO
M#]8`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LV11RA_\D*49Q3S'*UN=
M1;V08BQ8%LD47.F>;O'K.]OJQ='"=TPD["0+IUZ178AHB<2I);_:FEV0XL]?
M-\7B:5N3C:'\NP6IADP&CG19^L*92W_D!5X[0]]9^@?@1=]_]&J^_NN[]=VB
M_J\"YMW_3',C]<&G(^Z#,M]!+L<U.RWC!<;%]P+GO3ML]1RZ3!F+OO_4=#V.
M__VJSO\7I.L'M>+[[TK@?;M]?7GY`3NG2F"'M!+0865HFFI-^U'32?OCQZ/3
M"R1NE6)&I=*W78X_.SW*XAV[S_'<HQPOEBJ58;E,R"O-:\`K3"QD/:(HH)J@
M#CG;N[.W[V\4V&H2<G-U>?33#:X.?,T#7ID\0@*_@6R"I)!U-@9U`%MO\$_#
M^T*RWQ#46^>U>AW-43E$>3%3LAYJK6T=/L-O9'T]I!2P6[W3*&.(2C0VRV6,
MB)"LC^^G&[PA!-M@U$5J$/B$J#)':A;%Z<UU.U;>-(%G34BG5$C?M$&479#1
M1PCV)M$Y<0\\)7\ES0&H$H/Z#1]L'Q^3"7)Z*!/%()<V?(!6I)YV=7)Y\6L#
M0KQNJ<A#Y*`!?!:IS080!OQ@=Y;-Q+!D6GQ@X,;84_.--:V""PPA4$5R(NDS
M<,7^0L4,<`)0'87;__SMS\=H[;;8$'\JW#AHDD;BG?-S/,II[&MAH=@$J'YD
:ON<.A`(***"``@HHH(#O!/X&F"G8>``H````
`
end
------------------------------------------------------------------------
More information about the Gcc-bugs
mailing list