From 8658c256227fee97c9b5d2d2ab9a2e469759993d Mon Sep 17 00:00:00 2001 From: Marco Vanotti Date: Wed, 3 Apr 2019 15:48:43 -0700 Subject: executor: don't fallthrough in switches in fuchsia (#1103) This commit modifies the common_fuchsia.h file changing the behavior of the `syz_future_time function`. Before, the function used to have a switch case that would fallthrough, making it always set the delta_ms to 10000. The fix is to add a `break;` statement after each switch case. --- executor/common_fuchsia.h | 3 +++ pkg/csource/generated.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/executor/common_fuchsia.h b/executor/common_fuchsia.h index 9749f668b..72b578012 100644 --- a/executor/common_fuchsia.h +++ b/executor/common_fuchsia.h @@ -226,10 +226,13 @@ static long syz_future_time(volatile long when) switch (when) { case 0: delta_ms = 5; + break; case 1: delta_ms = 30; + break; default: delta_ms = 10000; + break; } zx_time_t now = zx_clock_get(ZX_CLOCK_MONOTONIC); return now + delta_ms * 1000 * 1000; diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index facd7543f..0eab6956a 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -969,10 +969,13 @@ static long syz_future_time(volatile long when) switch (when) { case 0: delta_ms = 5; + break; case 1: delta_ms = 30; + break; default: delta_ms = 10000; + break; } zx_time_t now = zx_clock_get(ZX_CLOCK_MONOTONIC); return now + delta_ms * 1000 * 1000; -- cgit mrf-deployment