Project

General

Profile

Actions

Bug #1246

closed

--filter expression parser accepts foo[bar]

Added by Simon Marchi almost 5 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/19/2020
Due date:
% Done:

0%

Estimated time:

Description

According to the doc, it is only possible to access arrays elements using positive literal integer numbers. However, the parser accepts:

./lttng enable-event -u -a --filter 'allo[toi] == 2'

Internally, create_load_expression creates a ir_load_expression_op node with type IR_LOAD_EXPRESSION_GET_INDEX. However, the associated index value is the value of the pointer to the toi string, interpreted as an unsigned integer by visit_node_load_expression when generating the bytecode.

I think this user error should be caught earlier and result in an error on the client side.

Actions

Also available in: Atom PDF