aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 1942281..b6ecc0f 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1455,7 +1455,11 @@ StateStart::custom(gchar chr)
BEGIN_EXEC(this);
v = interface.ssm(SCI_GETCURRENTPOS) +
expressions.pop_num_calc();
- if (!Validate::pos(v))
+ /*
+ * NOTE: We cannot use Validate::pos() here since
+ * the end of the buffer is not a valid position for <A>.
+ */
+ if (v < 0 || v >= interface.ssm(SCI_GETLENGTH))
throw RangeError("A");
expressions.push(interface.ssm(SCI_GETCHARAT, v));
break;