Example #1
0
static VALUE
rb_mod_remove_method(VALUE mod, SEL sel, int argc, VALUE *argv)
{
    for (int i = 0; i < argc; i++) {
	remove_method(mod, rb_to_id(argv[i]));
    }
    return mod;
}
Example #2
0
static VALUE
rb_mod_remove_method(int argc, VALUE *argv, VALUE mod)
{
    int i;

    for (i = 0; i < argc; i++) {
	remove_method(mod, rb_to_id(argv[i]));
    }
    return mod;
}
Example #3
0
void relocate_method(DexMethod* method, DexType* to_type) {
  auto from_cls = type_class(method->get_class());
  auto to_cls = type_class(to_type);
  from_cls->remove_method(method);
  DexMethodSpec spec;
  spec.cls = to_type;
  method->change(spec,
                 true /* rename on collision */,
                 true /* update deobfuscated name */);
  to_cls->add_method(method);
}
Example #4
0
mrb_value
mrb_mod_remove_method(mrb_state *mrb, mrb_value mod)
{
  int argc;
  mrb_value *argv;

  mrb_get_args(mrb, "*", &argv, &argc);
  while (argc--) {
    remove_method(mrb, mod, mrb_symbol(*argv));
    argv++;
  }
  return mod;
}
Example #5
0
static VALUE
rb_mod_remove_method(int argc, VALUE *argv, VALUE mod)
{
    int i;

    for (i = 0; i < argc; i++) {
	VALUE v = argv[i];
	ID id = rb_check_id(&v);
	if (!id) {
	    rb_name_error_str(v, "method `%"PRIsVALUE"' not defined in %"PRIsVALUE,
			      v, rb_obj_class(mod));
	}
	remove_method(mod, id);
    }
    return mod;
}
static VALUE
rb_mod_remove_method(int argc, VALUE *argv, VALUE mod)
{
    int i;

    for (i = 0; i < argc; i++) {
	VALUE v = argv[i];
	ID id = rb_check_id(&v);
	if (!id) {
	    rb_name_error_str(v, "method `%s' not defined in %s",
			      RSTRING_PTR(v), rb_class2name(mod));
	}
	remove_method(mod, id);
    }
    return mod;
}
Example #7
0
 void delete_unused_bridgees() {
   for (auto bpair : m_bridges_to_bridgees) {
     auto bridge = bpair.first;
     auto bridgee = bpair.second;
     always_assert_log(bridge->is_virtual(),
                       "bridge: %s\nbridgee: %s",
                       SHOW(bridge),
                       SHOW(bridgee));
     // TODO: Bridgee won't necessarily be direct once we expand this
     // optimization
     redex_assert(!bridgee->is_virtual());
     auto cls = type_class(bridgee->get_class());
     cls->remove_method(bridgee);
     DexMethod::erase_method(bridgee);
   }
 }
Example #8
0
/*
 * Called after successful authentication. Will remove the successful method
 * from the start of each list in which it occurs. If it was the last method
 * in any list, then authentication is deemed successful.
 * Returns 1 if the method completed any authentication list or 0 otherwise.
 */
int
auth2_update_methods_lists(Authctxt *authctxt, const char *method)
{
	u_int i, found = 0;

	debug3("%s: updating methods list after \"%s\"", __func__, method);
	for (i = 0; i < authctxt->num_auth_methods; i++) {
		if (!remove_method(&(authctxt->auth_methods[i]), method))
			continue;
		found = 1;
		if (*authctxt->auth_methods[i] == '\0') {
			debug2("authentication methods list %d complete", i);
			return 1;
		}
		debug3("authentication methods list %d remaining: \"%s\"",
		    i, authctxt->auth_methods[i]);
	}
	/* This should not happen, but would be bad if it did */
	if (!found)
		fatal("%s: method not in AuthenticationMethods", __func__);
	return 0;
}
Example #9
0
void
rb_remove_method(VALUE klass, const char *name)
{
    remove_method(klass, rb_intern(name));
}
Example #10
0
void
rb_remove_method_id(VALUE klass, ID mid)
{
    remove_method(klass, mid);
}