diff options
author | Kyle Russell <bkylerussell@gmail.com> | 2020-02-17 10:25:52 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-19 11:26:12 +0000 |
commit | 06b2c82a436c0806d6d1dc0ef3828fdc82f19576 (patch) | |
tree | e2a3d16e1940068dd9e82f664a24bf6e0dd75332 | |
parent | 14ba850aa97f446e4afe0386c5c3d391a85d5f01 (diff) | |
download | poky-06b2c82a436c0806d6d1dc0ef3828fdc82f19576.tar.gz |
bitbake: data: Don't allow renameVar calls with equivalent keys
While usually a programming error, the behavior can cause a Parser
instance to eventually gobble up a significant amount of memory,
greatly affecting system performance. Try to avoid getting into
that situation and alert the user about what they attempted to do.
(Bitbake rev: 01bf0912eef5700d61c6e3c9138cb4b6825ee782)
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/data_smart.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index dd5c618564..63a32bc6a7 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py | |||
@@ -607,6 +607,10 @@ class DataSmart(MutableMapping): | |||
607 | """ | 607 | """ |
608 | Rename the variable key to newkey | 608 | Rename the variable key to newkey |
609 | """ | 609 | """ |
610 | if key == newkey: | ||
611 | bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key) | ||
612 | return | ||
613 | |||
610 | if '_remote_data' in self.dict: | 614 | if '_remote_data' in self.dict: |
611 | connector = self.dict["_remote_data"]["_content"] | 615 | connector = self.dict["_remote_data"]["_content"] |
612 | res = connector.renameVar(key, newkey) | 616 | res = connector.renameVar(key, newkey) |