Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
ctf: add implicitly defined enums at the end of the range
Browse files Browse the repository at this point in the history
Make implicitly declared enumerations have a value == range.max + 1

To be clear:

enum bob {4-7};
enum alice;

bob is added with a range of 4-7
alice is now added with a range of 8-8 instead of 5-8 as it was before

Link: lttng/lttng-scope#79
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ic88b5749e1a19548f8c1342f54acf290a173a28d
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/131749
Tested-by: CI Bot
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
MatthewKhouzam committed Oct 31, 2018
1 parent b73c54e commit 6fe5445
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ public boolean add(long low, long high, @Nullable String label) {
* @since 2.0
*/
public boolean add(@Nullable String label) {
return add(fLastAdded.fFirst + 1, fLastAdded.fSecond + 1, label);
// add the item with a value of max(range)+1 for low and high to ensure no overlap
return add(fLastAdded.fSecond + 1, fLastAdded.fSecond + 1, label);
}

/**
Expand Down

0 comments on commit 6fe5445

Please sign in to comment.