Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
4d0ee2a5
Commit
4d0ee2a5
authored
7 years ago
by
Craig Tiller
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #10605 from ctiller/ubsan
Ubsan fixes
parents
b78e80c0
7fea7512
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/lib/iomgr/sockaddr_utils.c
+3
-1
3 additions, 1 deletion
src/core/lib/iomgr/sockaddr_utils.c
src/core/lib/slice/slice.c
+4
-2
4 additions, 2 deletions
src/core/lib/slice/slice.c
src/core/lib/transport/pid_controller.c
+1
-0
1 addition, 0 deletions
src/core/lib/transport/pid_controller.c
with
8 additions
and
3 deletions
src/core/lib/iomgr/sockaddr_utils.c
+
3
−
1
View file @
4d0ee2a5
...
...
@@ -55,7 +55,9 @@ int grpc_sockaddr_is_v4mapped(const grpc_resolved_address *resolved_addr,
GPR_ASSERT
(
resolved_addr
!=
resolved_addr4_out
);
const
struct
sockaddr
*
addr
=
(
const
struct
sockaddr
*
)
resolved_addr
->
addr
;
struct
sockaddr_in
*
addr4_out
=
(
struct
sockaddr_in
*
)
resolved_addr4_out
->
addr
;
resolved_addr4_out
==
NULL
?
NULL
:
(
struct
sockaddr_in
*
)
resolved_addr4_out
->
addr
;
if
(
addr
->
sa_family
==
AF_INET6
)
{
const
struct
sockaddr_in6
*
addr6
=
(
const
struct
sockaddr_in6
*
)
addr
;
if
(
memcmp
(
addr6
->
sin6_addr
.
s6_addr
,
kV4MappedPrefix
,
...
...
This diff is collapsed.
Click to expand it.
src/core/lib/slice/slice.c
+
4
−
2
View file @
4d0ee2a5
...
...
@@ -197,6 +197,7 @@ grpc_slice grpc_slice_new_with_len(void *p, size_t len,
}
grpc_slice
grpc_slice_from_copied_buffer
(
const
char
*
source
,
size_t
length
)
{
if
(
length
==
0
)
return
grpc_empty_slice
();
grpc_slice
slice
=
grpc_slice_malloc
(
length
);
memcpy
(
GRPC_SLICE_START_PTR
(
slice
),
source
,
length
);
return
slice
;
...
...
@@ -382,8 +383,9 @@ grpc_slice grpc_slice_split_head(grpc_slice *source, size_t split) {
}
int
grpc_slice_default_eq_impl
(
grpc_slice
a
,
grpc_slice
b
)
{
return
GRPC_SLICE_LENGTH
(
a
)
==
GRPC_SLICE_LENGTH
(
b
)
&&
0
==
memcmp
(
GRPC_SLICE_START_PTR
(
a
),
GRPC_SLICE_START_PTR
(
b
),
if
(
GRPC_SLICE_LENGTH
(
a
)
!=
GRPC_SLICE_LENGTH
(
b
))
return
false
;
if
(
GRPC_SLICE_LENGTH
(
a
)
==
0
)
return
true
;
return
0
==
memcmp
(
GRPC_SLICE_START_PTR
(
a
),
GRPC_SLICE_START_PTR
(
b
),
GRPC_SLICE_LENGTH
(
a
));
}
...
...
This diff is collapsed.
Click to expand it.
src/core/lib/transport/pid_controller.c
+
1
−
0
View file @
4d0ee2a5
...
...
@@ -49,6 +49,7 @@ void grpc_pid_controller_reset(grpc_pid_controller *pid_controller) {
double
grpc_pid_controller_update
(
grpc_pid_controller
*
pid_controller
,
double
error
,
double
dt
)
{
if
(
dt
==
0
)
return
pid_controller
->
last_control_value
;
/* integrate error using the trapezoid rule */
pid_controller
->
error_integral
+=
dt
*
(
pid_controller
->
last_error
+
error
)
*
0
.
5
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment