コード例 #1
0
static Dwarf *
scngrp_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Dwarf_Cmd cmd,
	     Elf_Scn *scngrp)
{
  /* SCNGRP is the section descriptor for a section group which might
     contain debug sections.  */
  Elf_Data *data = elf_getdata (scngrp, NULL);
  if (data == NULL)
    {
      /* We cannot read the section content.  Fail!  */
      free (result);
      return NULL;
    }

  /* The content of the section is a number of 32-bit words which
     represent section indices.  The first word is a flag word.  */
  Elf32_Word *scnidx = (Elf32_Word *) data->d_buf;
  size_t cnt;
  for (cnt = 1; cnt * sizeof (Elf32_Word) <= data->d_size; ++cnt)
    {
      Elf_Scn *scn = elf_getscn (elf, scnidx[cnt]);
      if (scn == NULL)
	{
	  /* A section group refers to a non-existing section.  Should
	     never happen.  */
	  __libdw_seterrno (DWARF_E_INVALID_ELF);
	  free (result);
	  return NULL;
	}

      check_section (result, ehdr, scn, true);
    }

  return valid_p (result);
}
コード例 #2
0
static Dwarf *
global_read (Dwarf *result, Elf *elf, GElf_Ehdr *ehdr, Dwarf_Cmd cmd)
{
  Elf_Scn *scn = NULL;

  while ((scn = elf_nextscn (elf, scn)) != NULL)
    check_section (result, ehdr, scn, false);

  return valid_p (result);
}
コード例 #3
0
ファイル: inline_cache.cpp プロジェクト: Twisol/rubinius
  bool InlineCache::update_and_validate(STATE, CallFrame* call_frame, Object* recv) {
    if(valid_p(state, recv)) return true;

    set_klass(recv->lookup_begin(state));

    MethodMissingReason reason = fill_public(state, call_frame->self(), name);
    if(reason != eNone) return false;

    update_seen_classes();
    run_wb(state, call_frame->cm);

    return true;
  }
コード例 #4
0
ファイル: inline_cache.cpp プロジェクト: Twisol/rubinius
  bool InlineCache::update_and_validate_private(STATE, CallFrame* call_frame, Object* recv) {
    if(valid_p(state, recv)) return true;

    set_klass(recv->lookup_begin(state));

    if(!fill_private(state, name, klass())) {
      return false;
    }

    update_seen_classes();
    run_wb(state, call_frame->cm);

    return true;
  }
コード例 #5
0
ファイル: passwd.c プロジェクト: RazZziel/pongclock
/* A basic auth driver that simply prompts for a password then runs it through
 * valid_p to determine whether the password is correct.
 */
static void
try_unlock_password(saver_info *si,
		   Bool verbose_p,
		   Bool (*valid_p)(const char *typed_passwd, Bool verbose_p))
{
  struct auth_message message;
  struct auth_response *response = NULL;

  memset(&message, 0, sizeof(message));

  if (verbose_p)
    fprintf(stderr, "%s: non-PAM password auth.\n", blurb());

  /* Call the auth_conv function with "Password:"******"Password:";

  si->unlock_cb(1, &message, &response, si);

  if (!response)
    return;

  if (valid_p (response->response, verbose_p))
    si->unlock_state = ul_success;	       /* yay */
  else if (si->unlock_state == ul_cancel ||
           si->unlock_state == ul_time)
    ;					       /* more specific failures ok */
  else
    si->unlock_state = ul_fail;		       /* generic failure */

  if (response->response)
    free(response->response);
  free(response);
}
コード例 #6
0
ファイル: local_info.hpp プロジェクト: AndrewVos/rubinius
 // Indicate if the argument is never changed in the body
 // and the type is already known.
 bool static_type_argument_p() {
   return valid_p() && argument_ && sets_ == 0 && known_type_.known_p();
 }