The SBValue.linked_list_iter() API failed for an empty list.

Fix the bug and add a test case.

llvm-svn: 136265
This commit is contained in:
Johnny Chen
2011-07-27 21:14:01 +00:00
parent 03f56d9de6
commit bfdf9a36d9
3 changed files with 25 additions and 5 deletions

View File

@@ -129,12 +129,10 @@ linked_list_iter_def = '''
"""
try:
item = self.GetChildMemberWithName(next_item_name)
while item:
while not end_of_list_test(item):
yield item
# Prepare for the next iteration.
item = item.GetChildMemberWithName(next_item_name)
if end_of_list_test(item):
break
except:
# Exception occurred. Stop the generator.
pass