https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90110

--- Comment #4 from Ian Lance Taylor <ian at airs dot com> ---
Thanks for the file.  Unfortunately it looks fine.

The error is coming from Import_function_body::read_type in
gcc/go/gofrontend/import.cc.  At the point of the error this->body_ +
this->off_ points to a string starting with "<type 4>,".  The function starts
like this:

  this->require_c_string("<type ");
  size_t start = this->off_;
  size_t i;
  int c = '\0';
  for (i = start; i < this->body_.length(); ++i)
    {
      c = static_cast<unsigned char>(this->body_[i]);
      if (c != '-' && (c < '0' || c > '9'))
        break;
    }
  this->off_ = i + 1;

  char *end;
  long val = strtol(this->body_.substr(start, i - start).c_str(), &end, 10);
  if (*end != '\0' || i > 0x7fffffff)
    {
      if (!this->saw_error_)
        go_error_at(this->location(),
                    "invalid export data for %qs: expected integer at %lu",
                    this->name().c_str(),
                    static_cast<unsigned long>(start));
      this->saw_error_ = true;
      return Type::make_error_type();
    }

It skips "<type ", leaving itself looking at "4>,".  It steps past the "4". 
Then it passes "4\0" to strtol.  Somehow that is failing.

Since, needless to say, I can't reproduce the problem, do you have time to add
a bit of debugging around the strtol call, to see what is being passed and
returned?

Reply via email to