summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-12-09 21:45:01 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2012-12-09 21:45:01 -0800
commitd483e8253b0b883c8c168c4a1b4faf89655b07ac (patch)
tree07b388920f4fb4240cb0c909a5937091b0c27b7a
parent9168d166ae30a23b208b1d28ca2978f4e4309edd (diff)
parent0303faf69676d77b76832ef17e17e9e2dbcd2e22 (diff)
downloadmruby-d483e8253b0b883c8c168c4a1b4faf89655b07ac.tar.gz
mruby-d483e8253b0b883c8c168c4a1b4faf89655b07ac.zip
Merge pull request #604 from skandhas/pr-fix-check_iv_name
fix incorrect checkups in check_iv_name
-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);
}
}