Skip to content
Commit cf5ed6dc authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Pavel Labath
Browse files

Fix error handling after [<index>] in 'frame variable'

Summary:
This fixes a bug where

frame var a[0]+5

returns the value a[0] without any warning because the current logic simply ignores everything after ']' as long as there is no '.', '-' or '[' in the rest of the string.

The fix simplifies the termination condition of the expression path parsing loop to check if have a non-empty remaining string to parse. Previously, the condition checked if a separator was found. That condition coincided with the remaining string-to-parse condition except for the buggy indexed case where non-empty string was left ("+5" in the example above), but the separator index was 'npos'.

Reviewed By: teemperor, labath

Differential Revision: https://reviews.llvm.org/D79404
parent 0054c460
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment