Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
f3e86fd2
Commit
f3e86fd2
authored
Dec 30, 2016
by
@rubynerd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle sanity check for repeating enums correctly
parent
c64830bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
storage.c
ruby/ext/google/protobuf_c/storage.c
+11
-3
No files found.
ruby/ext/google/protobuf_c/storage.c
View file @
f3e86fd2
...
...
@@ -595,12 +595,20 @@ static void check_repeated_field_type(VALUE val, const upb_fielddef* field) {
rb_raise
(
rb_eTypeError
,
"Repeated field array has wrong element type"
);
}
if
(
self
->
field_type
==
UPB_TYPE_MESSAGE
||
self
->
field_type
==
UPB_TYPE_ENUM
)
{
if
(
self
->
field_type
==
UPB_TYPE_MESSAGE
)
{
if
(
self
->
field_type_class
!=
Descriptor_msgclass
(
get_def_obj
(
upb_fielddef_subdef
(
field
))))
{
rb_raise
(
rb_eTypeError
,
"Repeated field array has wrong message/enum class"
);
"Repeated field array has wrong message class"
);
}
}
if
(
self
->
field_type
==
UPB_TYPE_ENUM
)
{
if
(
self
->
field_type_class
!=
EnumDescriptor_enummodule
(
get_def_obj
(
upb_fielddef_subdef
(
field
))))
{
rb_raise
(
rb_eTypeError
,
"Repeated field array has wrong enum class"
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment