Skip to content

Commit c3ad61a

Browse files
committed
Add a similar check in stack_alloc than in FFI::MemoryPointer#initialize
1 parent cac53e6 commit c3ad61a

File tree

1 file changed

+1
-1
lines changed
  • src/main/ruby/truffleruby/core/truffle/ffi

1 file changed

+1
-1
lines changed

src/main/ruby/truffleruby/core/truffle/ffi/pointer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def self.stack_alloc(*args)
280280
when Symbol
281281
Pointer.find_type_size(type)
282282
else
283-
type.size
283+
raise ArgumentError, "incorrect pointer type: #{type.inspect}"
284284
end
285285
length = (type_size * count)
286286
offsets << [total_length, length]

0 commit comments

Comments
 (0)