[][PATCH] bitbake: 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.
Signed-off-by Kyle Russell <[email protected]>
--- lib/bb/data_smart.py | 4 ++++ 1 file changed, 4 insertions(+)
lib/bb/data_smart.py +4 -0
@@ -607,6 +607,10 @@ class DataSmart(MutableMapping): """ Rename the variable key to newkey """ + if key == newkey: + bb.warn("Calling renameVar with equivalent keys (%s) is invalid" % key) + return + if '_remote_data' in self.dict: connector = self.dict["_remote_data"]["_content"] res = connector.renameVar(key, newkey)
Signature · 1 line
2.17.1