mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
Introduce RBIMPL_NONNULL_ARG
macro
Runtime assertion for the argument declared as non-null. This macro does nothing if `RBIMPL_ATTR_NONNULL` is effective, otherwise asserts that the argument is non-null.
This commit is contained in:
parent
582602d142
commit
f7ffe9dbde
Notes:
git
2021-09-27 14:48:20 +09:00
Merged: https://github.com/ruby/ruby/pull/4898 Merged-By: nobu <nobu@ruby-lang.org>
3 changed files with 6 additions and 13 deletions
|
@ -3446,11 +3446,9 @@ rb_arithmetic_sequence_extract(VALUE obj, rb_arithmetic_sequence_components_t *c
|
|||
VALUE
|
||||
rb_arithmetic_sequence_beg_len_step(VALUE obj, long *begp, long *lenp, long *stepp, long len, int err)
|
||||
{
|
||||
#if !RBIMPL_HAS_ATTRIBUTE(nonnull)
|
||||
RUBY_ASSERT(begp != NULL);
|
||||
RUBY_ASSERT(lenp != NULL);
|
||||
RUBY_ASSERT(stepp != NULL);
|
||||
#endif
|
||||
RBIMPL_NONNULL_ARG(begp);
|
||||
RBIMPL_NONNULL_ARG(lenp);
|
||||
RBIMPL_NONNULL_ARG(stepp);
|
||||
|
||||
rb_arithmetic_sequence_components_t aseq;
|
||||
if (!rb_arithmetic_sequence_extract(obj, &aseq)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue