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
c02a6fbf
Commit
c02a6fbf
authored
Aug 16, 2019
by
Joshua Haberman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix for GC mark of oneof fields.
parent
013a0ea8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
encode_decode.c
ruby/ext/google/protobuf_c/encode_decode.c
+3
-0
protobuf.h
ruby/ext/google/protobuf_c/protobuf.h
+1
-0
storage.c
ruby/ext/google/protobuf_c/storage.c
+1
-1
No files found.
ruby/ext/google/protobuf_c/encode_decode.c
View file @
c02a6fbf
...
...
@@ -155,6 +155,9 @@ static const void *newoneofhandlerdata(upb_handlers *h,
// create a separate ID space. In addition, using the field tag number here
// lets us easily look up the field in the oneof accessor.
hd
->
oneof_case_num
=
upb_fielddef_number
(
f
);
if
(
is_value_field
(
f
))
{
hd
->
oneof_case_num
|=
ONEOF_CASE_MASK
;
}
hd
->
subklass
=
field_type_class
(
desc
->
layout
,
f
);
upb_handlers_addcleanup
(
h
,
hd
,
xfree
);
return
hd
;
...
...
ruby/ext/google/protobuf_c/protobuf.h
View file @
c02a6fbf
...
...
@@ -370,6 +370,7 @@ VALUE native_slot_encode_and_freeze_string(upb_fieldtype_t type, VALUE value);
void
native_slot_check_int_range_precision
(
const
char
*
name
,
upb_fieldtype_t
type
,
VALUE
value
);
uint32_t
slot_read_oneof_case
(
MessageLayout
*
layout
,
const
void
*
storage
,
const
upb_oneofdef
*
oneof
);
bool
is_value_field
(
const
upb_fielddef
*
f
);
extern
rb_encoding
*
kRubyStringUtf8Encoding
;
extern
rb_encoding
*
kRubyStringASCIIEncoding
;
...
...
ruby/ext/google/protobuf_c/storage.c
View file @
c02a6fbf
...
...
@@ -473,7 +473,7 @@ static size_t align_up_to(size_t offset, size_t granularity) {
return
(
offset
+
granularity
-
1
)
&
~
(
granularity
-
1
);
}
static
bool
is_value_field
(
const
upb_fielddef
*
f
)
{
bool
is_value_field
(
const
upb_fielddef
*
f
)
{
return
upb_fielddef_isseq
(
f
)
||
upb_fielddef_issubmsg
(
f
)
||
upb_fielddef_isstring
(
f
);
}
...
...
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