aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
authorBob Dubner <rdubner@symas.com>2025-04-02 12:18:08 -0400
committerRobert Dubner <rdubner@symas.com>2025-04-02 14:40:14 -0400
commit29ac3adb8f72ecbe734d535b1015fe8b411316cb (patch)
tree9893c307e448d93ff49206e2a168f994e3e4d5ae /gcc/rust/backend/rust-compile-expr.cc
parenta2e03736fc932ef613ad01a9499126cbaa538bf8 (diff)
downloadgcc-29ac3adb8f72ecbe734d535b1015fe8b411316cb.zip
gcc-29ac3adb8f72ecbe734d535b1015fe8b411316cb.tar.gz
gcc-29ac3adb8f72ecbe734d535b1015fe8b411316cb.tar.bz2
cobol: Plug memory leak caused by intermediate_e stack-frame variables. [PR119521]
COBOL variables with attribute intermediate_e are being allocated on the stack frame, but their data was assigned using malloc(), without a corresponding call to free(). For numerics, the problem is solved with a fixed allocation of sixteen bytes for the cblc_field_t::data member (sixteen is big enough for all data types) and with a fixed allocation of 8,192 bytes for the alphanumeric type. In use, the intermediate numeric data types are "shrunk" to the minimum applicable size. The intermediate alphanumerics, generally used as destination targets for functions, are trimmed as well. gcc/cobol PR cobol/119521 * genapi.cc: (parser_division): Change comment. (parser_symbol_add): Change intermediate_t handling. * parse.y: Multiple changes to new_alphanumeric() calls. * parse_ante.h: Establish named constant for date function calls. Change declaration of new_alphanumeric() function. * symbols.cc: (new_temporary_impl): Use named constant for default size of temporary alphanumerics. * symbols.h: Establish MAXIMUM_ALPHA_LENGTH constant. libgcobol PR cobol/119521 * intrinsic.cc: (__gg__reverse): Trim final result for intermediate_e. * libgcobol.cc: (__gg__adjust_dest_size): Abort on attempt to increase the size of a result. (__gg__module_name): Formatting. __gg__reverse(): Resize only intermediates
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
0 files changed, 0 insertions, 0 deletions