[all-commits] [llvm/llvm-project] cf5ed6: Fix error handling after [<index>] in 'frame varia...

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed May 6 02:04:26 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cf5ed6dc59ec8e416cca91c8145b1f09d891f130
      https://github.com/llvm/llvm-project/commit/cf5ed6dc59ec8e416cca91c8145b1f09d891f130
  Author: Jaroslav Sevcik <jarin at google.com>
  Date:   2020-05-06 (Wed, 06 May 2020)

  Changed paths:
    M lldb/source/Target/StackFrame.cpp
    M lldb/test/API/functionalities/var_path/TestVarPath.py

  Log Message:
  -----------
  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




More information about the All-commits mailing list