binutils-gdb/gdb/testsuite/gdb.fortran
Nils-Christian Kempke a60ead5ded gdb, testsuite, fortran: fix double free in mixed-lang-stack.exp
While testing mixed-lang-stack I realized that valgrind actually
complained about a double free in the test.

   All done
  ==2503051==
  ==2503051== HEAP SUMMARY:
  ==2503051==     in use at exit: 0 bytes in 0 blocks
  ==2503051==   total heap usage: 26 allocs, 27 frees, 87,343 bytes allocated
  ==2503051==
  ==2503051== All heap blocks were freed -- no leaks are possible
  ==2503051==
  ==2503051== For lists of detected and suppressed errors, rerun with: -s
  ==2503051== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Reason for this is that in mixed-lang-stack.cpp in mixed_func_1f an
object "derived_type obj" goes on the stack which is then passed-by-value
(so copied) to mixed_func_1g.  The default copy-ctor will be called but,
since derived_type contains a heap allocated string and the copy
constructor is not implemented it will only be able to shallow copy the
object.  Right after each of the functions the object gets freed - on the
other hand the d'tor of derived_type actually is implemented and calls
free on the heap allocated string which leads to a double free.  Instead
of obeying the rule of 3/5 I just got rid of all that since it does not
serve the test.  The string is now just a const char* = ".." object
member.
2022-05-31 16:44:56 +02:00
..
allocated.exp
allocated.f90
array-bounds-high.exp
array-bounds-high.f90
array-bounds.exp
array-bounds.f90
array-element.exp
array-element.f
array-indices.exp
array-no-bounds.exp
array-no-bounds.f90
array-repeat.exp
array-repeat.f90
array-slices-bad.exp
array-slices-bad.f90
array-slices-repeat.f90
array-slices-sub-slices.exp
array-slices-sub-slices.f90
array-slices.exp
array-slices.f90
associated.exp
associated.f90
assumedrank.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
assumedrank.f90
block-data.exp
block-data.f
call-no-debug-func.f90
call-no-debug-prog.f90
call-no-debug.exp
charset.exp gdb/testsuite: disable charset.exp for intel compilers 2022-05-31 16:44:54 +02:00
charset.f90
class-allocatable-array.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
class-allocatable-array.f90
common-block.exp
common-block.f90
completion.exp
completion.f90
complex.exp
complex.f90
debug-expr.exp
debug-expr.f90
derived-type-function.exp
derived-type-function.f90
derived-type-striding.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
derived-type-striding.f90
derived-type.exp
derived-type.f90
dot-ops.exp
dynamic-ptype-whatis.exp testsuite, fortran: add compiler dependent types to dynamic-ptype-whatis 2022-05-31 16:44:55 +02:00
dynamic-ptype-whatis.f90
exprs.exp
function-calls.exp
function-calls.f90 testsuite, fortran: add required external keyword 2022-05-31 16:44:55 +02:00
info-modules.exp
info-types-2.f90
info-types.exp testsuite, fortran: fix info-types for intel compilers 2022-05-31 16:44:56 +02:00
info-types.f90
intrinsics.exp
intrinsics.f90
intvar-array.exp
intvar-array.f90
intvar-dynamic-types.exp
intvar-dynamic-types.f90
lbound-ubound.exp
lbound-ubound.F90
library-module-lib.f90
library-module-main.f90
library-module.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
logical.exp
logical.f90
max-depth.exp
max-depth.f90
mixed-lang-stack.c
mixed-lang-stack.cpp gdb, testsuite, fortran: fix double free in mixed-lang-stack.exp 2022-05-31 16:44:56 +02:00
mixed-lang-stack.exp
mixed-lang-stack.f90
module.exp testsuite, fortran: allow additional completions in module.exp 2022-05-31 16:44:56 +02:00
module.f90
multi-dim.exp
multi-dim.f90
namelist.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
namelist.f90
nested-funcs-2.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
nested-funcs-2.f90
nested-funcs.exp
nested-funcs.f90
oop_extend_type.exp
oop_extend_type.f90
pointer-to-pointer.exp
pointer-to-pointer.f90
pointers.f90
print-formatted.exp
print-formatted.f90
print_type.exp
printing-types.exp
printing-types.f90
ptr-indentation.exp
ptr-indentation.f90
ptype-on-functions.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
ptype-on-functions.f90
rank.exp
rank.f90
shape.exp
shape.f90
short-circuit-argument-list.exp
short-circuit-argument-list.f90
size.exp
size.f90
subarray.exp
subarray.f
type-kinds.exp
type.f90
types.exp
vla-alloc-assoc.exp
vla-datatypes.exp
vla-datatypes.f90
vla-history.exp
vla-ptr-info.exp
vla-ptype-sub.exp
vla-ptype.exp
vla-sizeof.exp
vla-sub.f90
vla-type.exp gdb/testsuite: add Fortran compiler identification to GDB 2022-05-31 16:44:54 +02:00
vla-type.f90
vla-value-sub-arbitrary.exp
vla-value-sub-finish.exp
vla-value-sub.exp
vla-value.exp
vla.f90
whatis_type.exp