skc: Avoid undefined variable modification
Our code had two modifications of 'from' without a sequence point between them. This leaves the behavior undefined. We change the code to only modify 'from' once, and have this behavior well defined. Change-Id: Ifa4fb191ecc071fdb4793901eaef777294709467 Reviewed-on: https://skia-review.googlesource.com/c/191320 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
30595ea7c7
commit
837178206e
@ -529,7 +529,7 @@ skc_path_builder_impl_unmap(struct skc_path_builder_impl * const impl,
|
||||
0,NULL,NULL));
|
||||
|
||||
// bring from back in range
|
||||
from = ++from % impl->ring.subbufs;
|
||||
from = (from + 1) % impl->ring.subbufs;
|
||||
}
|
||||
}
|
||||
|
||||
@ -576,7 +576,7 @@ skc_path_builder_impl_map(struct skc_path_builder_impl * const impl,
|
||||
&cl_err); cl_ok(cl_err);
|
||||
|
||||
// bring from back in range
|
||||
from = ++from % impl->ring.subbufs;
|
||||
from = (from + 1) % impl->ring.subbufs;
|
||||
}
|
||||
//
|
||||
// FIXME -- when we switch to out of order queues we'll need a barrier here
|
||||
|
Loading…
Reference in New Issue
Block a user