summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kernel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kernel.c b/src/kernel.c
index 531c6d9d8..85eedc7ba 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -564,7 +564,7 @@ check_iv_name(mrb_state *mrb, mrb_sym id)
int len;
s = mrb_sym2name_len(mrb, id, &len);
- if (len < 2 || s[0] != '@') {
+ if (len < 2 || !(s[0] == '@' && s[1] != '@')) {
mrb_name_error(mrb, id, "`%s' is not allowed as an instance variable name", s);
}
}