bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix uneccesary copy of function bodies for BASH_SOURCE


From: Koichi Murase
Subject: Re: [PATCH] fix uneccesary copy of function bodies for BASH_SOURCE
Date: Tue, 4 Jun 2024 15:41:00 +0900

2024年6月4日(火) 15:11 konsolebox <konsolebox@gmail.com>:
> I haven't looked at this but it will keep lazy functions safe to
> implement right?

Right. The fix shouldn't change the observable behavior.

The functions are saved in two hash tables, `shell_functions' and
`shell_function_defs'. The function bodies are supposed to be put in
the former hash table, and the metadata (the source-file location and
the line where it is defined) are supposed to be put in the latter
hash table. However, we reuse the data structure for the function
declaration (containing both bodies and metadata) to keep the
metadata, and the function bodies were also contained in the latter
hash table unintentionally. We've been saving the data that has never
been used.

--
Koichi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]