Project

General

Profile

Bug #1451

dl in ruby-1.9 can't parse signatures correctly.

Added by sheepman (Takashi Tamura) over 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-05-02 trunk 23326) [i686-linux]
Backport:
[ruby-dev:38398]

Description

=begin
1.9 の dl の cparser.rb が空白があるシグネチャを正しくパースできません。

$ cat d7.rb
require 'dl/import'

module M
extend DL::Importer
dlload 'libc.so.6'
extern 'void * memmove(void *, void *, unsigned long )'
end

$ ruby-1.9 -v d7.rb
ruby 1.9.2dev (2009-05-02 trunk 23326) [i686-linux]
/usr/local/pkg/ruby-1.9/lib/ruby/1.9.1/dl/cparser.rb:104:in parse_ctype': unknown type: unsigned long (DL::DLError)
from /usr/local/pkg/ruby-1.9/lib/ruby/1.9.1/dl/cparser.rb:53:in
block in parse_signature'
from /usr/local/pkg/ruby-1.9/lib/ruby/1.9.1/dl/cparser.rb:53:in collect'
from /usr/local/pkg/ruby-1.9/lib/ruby/1.9.1/dl/cparser.rb:53:in
parse_signature'
from /usr/local/pkg/ruby-1.9/lib/ruby/1.9.1/dl/import.rb:116:in extern'
from d7.rb:6:in
module:M'
from d7.rb:3:in `'

パッチです。

$ svn diff lib/dl/cparser.rb
Index: lib/dl/cparser.rb
===================================================================
--- lib/dl/cparser.rb (リビジョン 23328)
+++ lib/dl/cparser.rb (作業コピー)
@@ -41,7 +41,7 @@ module DL
case signature
when /[\\w@*\s]+)(([\d\w*\s\,[]]*))$/
ret = $1

  • args = $2
  • args = $2.sub(/\A\s*/, '').sub(/\s*\z/, '') ret = ret.split(/\s+/) args = args.split(/\s*,\s*/) func = ret.pop =end

History

#1

Updated by nobu (Nobuyoshi Nakada) over 10 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

=begin
Applied in changeset r23382.
=end

Also available in: Atom PDF