Ticket #24 (seen Problem)
inconsistent behavior with respect to out-of-range vector references
| Reported by: | vern | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Bro | Version: | |
| Keywords: | Cc: |
Description
[from Matthias & Christian]
This:
global foo: vector of count = { 42 };
print foo[0];
print foo[1];
print foo[2];
just prints 42 (index 1), with no warning that 0 and 2 don't exist. But this:
global foo: vector of count = { 42 };
global f0: count;
global f1: count;
global f2: count;
f0 = foo[0]; f1 = foo[1]; f2 = foo[2];
print f0; print f1; print f2;
yields
... run-time error, value used but not set 42 ... run-time error, value used but not set
whereas this:
global foo: vector of count; foo[0] = 42;
yields:
... (foo[0]): error, index (0) must be positive
Note: See
TracTickets for help on using
tickets.