Project

General

Profile

Feature #5089 » 0002-Fix-memory-access-issues-with-the-inadvertent-symbol.patch

jeremyevans0 (Jeremy Evans), 07/24/2011 03:21 PM

View differences:

eval_error.c
void
rb_print_undef_str(VALUE klass, VALUE name)
{
rb_name_error_str(name, "undefined method `%s' for %s `%s'",
RSTRING_PTR(name),
rb_name_error_str(rb_str_to_str(name), "undefined method `%s' for %s `%s'",
StringValuePtr(name),
(TYPE(klass) == T_MODULE) ? "module" : "class",
rb_class2name(klass));
}
object.c
if(rb_is_const_name(name)) {
if (rb_method_basic_definition_p(CLASS_OF(mod), id_const_missing)) {
if (mod && rb_class_real(mod) != rb_cObject) {
rb_name_error_str(name, "uninitialized constant %s::%s",
rb_name_error_str(rb_str_to_str(name), "uninitialized constant %s::%s",
rb_class2name(mod),
RSTRING_PTR(name));
StringValuePtr(name));
} else {
rb_name_error_str(name, "uninitialized constant %s", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "uninitialized constant %s",
StringValuePtr(name));
}
} else {
id = rb_to_id(name);
}
} else {
rb_name_error_str(name, "wrong constant name %s", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "wrong constant name %s",
StringValuePtr(name));
}
}
if (!rb_is_const_id(id)) {
......
return Qfalse;
}
else {
rb_name_error_str(name, "wrong constant name %s", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "wrong constant name %s",
StringValuePtr(name));
}
}
if (!rb_is_const_id(id)) {
......
return Qnil;
}
else {
rb_name_error_str(iv, "`%s' is not allowed as an instance variable name", RSTRING_PTR(iv));
rb_name_error_str(rb_str_to_str(iv), "`%s' is not allowed as an instance variable name",
StringValuePtr(iv));
}
}
if (!rb_is_instance_id(id)) {
......
return Qfalse;
}
else {
rb_name_error_str(iv, "`%s' is not allowed as an instance variable name", RSTRING_PTR(iv));
rb_name_error_str(rb_str_to_str(iv), "`%s' is not allowed as an instance variable name",
StringValuePtr(iv));
}
}
if (!rb_is_instance_id(id)) {
......
if (!id) {
if (rb_is_class_name(iv)) {
rb_name_error_str(iv, "uninitialized class variable %s in %s",
RSTRING_PTR(iv), rb_class2name(obj));
rb_name_error_str(rb_str_to_str(iv), "uninitialized class variable %s in %s",
StringValuePtr(iv), rb_class2name(obj));
}
else {
rb_name_error_str(iv, "`%s' is not allowed as a class variable name", RSTRING_PTR(iv));
rb_name_error_str(rb_str_to_str(iv), "`%s' is not allowed as a class variable name",
StringValuePtr(iv));
}
}
if (!rb_is_class_id(id)) {
......
return Qfalse;
}
else {
rb_name_error_str(iv, "`%s' is not allowed as a class variable name", RSTRING_PTR(iv));
rb_name_error_str(rb_str_to_str(iv), "`%s' is not allowed as a class variable name",
StringValuePtr(iv));
}
}
if (!rb_is_class_id(id)) {
proc.c
else if (RB_TYPE_P(c, T_MODULE)) {
s0 = " module";
}
rb_name_error_str(str, "undefined method `%s' for%s `%s'",
RSTRING_PTR(str), s0, rb_class2name(c));
rb_name_error_str(rb_str_to_str(str), "undefined method `%s' for%s `%s'",
StringValuePtr(str), s0, rb_class2name(c));
}
/*
variable.c
rb_scan_args(argc, argv, "11", &var, &cmd);
id = rb_check_id(var);
if (!id) {
rb_name_error_str(var, "undefined global variable %s", RSTRING_PTR(var));
rb_name_error_str(rb_str_to_str(var), "undefined global variable %s",
StringValuePtr(var));
}
if (!st_lookup(rb_global_tbl, (st_data_t)id, &data)) {
rb_name_error(id, "undefined global variable %s", rb_id2name(id));
......
rb_check_frozen(obj);
if (!id) {
if (rb_is_instance_name(name)) {
rb_name_error_str(name, "instance variable %s not defined", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "instance variable %s not defined",
StringValuePtr(name));
}
else {
rb_name_error_str(name, "`%s' is not allowed as an instance variable name", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "`%s' is not allowed as an instance variable name",
StringValuePtr(name));
}
}
if (!rb_is_instance_id(id)) {
......
if (!id) {
if (rb_is_const_name(name)) {
rb_name_error_str(name, "constant %s::%s not defined",
rb_class2name(mod), RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "constant %s::%s not defined",
rb_class2name(mod), StringValuePtr(name));
}
else {
rb_name_error_str(name, "`%s' is not allowed as a constant name", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "`%s' is not allowed as a constant name",
StringValuePtr(name));
}
}
if (!rb_is_const_id(id)) {
......
val = argv[i];
id = rb_check_id(val);
if (!id) {
rb_name_error_str(val, "constant %s::%s not defined", rb_class2name(mod), RSTRING_PTR(val));
rb_name_error_str(rb_str_to_str(val), "constant %s::%s not defined",
rb_class2name(mod), StringValuePtr(val));
}
if (RCLASS_CONST_TBL(mod) && st_lookup(RCLASS_CONST_TBL(mod), (st_data_t)id, &v)) {
((rb_const_entry_t*)v)->flag = flag;
......
if (!id) {
if (rb_is_class_name(name)) {
rb_name_error_str(name, "class variable %s not defined for %s",
RSTRING_PTR(name), rb_class2name(mod));
rb_name_error_str(rb_str_to_str(name), "class variable %s not defined for %s",
StringValuePtr(name), rb_class2name(mod));
}
else {
rb_name_error_str(name, "wrong class variable name %s", RSTRING_PTR(name));
rb_name_error_str(rb_str_to_str(name), "wrong class variable name %s",
StringValuePtr(name));
}
}
if (!rb_is_class_id(id)) {
vm_method.c
v = argv[i];
id = rb_check_id(v);
if (!id) {
rb_name_error_str(v, "method `%s' not defined in %s",
RSTRING_PTR(v), rb_class2name(mod));
rb_name_error_str(rb_str_to_str(v), "method `%s' not defined in %s",
StringValuePtr(v),
rb_class2name(mod));
}
remove_method(mod, id);
}
(2-2/2)