Use external linkage for global input buffer

This is to support running saved auto-generated test cases.
This commit is contained in:
Joe Ranweiler
2018-02-08 14:33:00 -08:00
parent c6eca451c5
commit dd8a1c6608
2 changed files with 15 additions and 11 deletions
+12
View File
@@ -51,6 +51,18 @@ DEEPSTATE_BEGIN_EXTERN_C
DECLARE_string(input_test_dir);
DECLARE_string(output_test_dir);
enum {
DeepState_InputSize = 8192
};
/* Byte buffer that will contain symbolic data that is used to supply requests
* for symbolic values (e.g. `int`s). */
extern volatile uint8_t DeepState_Input[DeepState_InputSize];
/* Index into the `DeepState_Input` array that tracks how many input bytes have
* been consumed. */
extern uint32_t DeepState_InputIndex;
/* Return a symbolic value of a given type. */
extern int DeepState_Bool(void);
extern size_t DeepState_Size(void);
+3 -11
View File
@@ -37,17 +37,9 @@ struct DeepState_TestInfo *DeepState_LastTestInfo = NULL;
/* Pointer to the test being run in this process by Dr. Fuzz. */
static struct DeepState_TestInfo *DeepState_DrFuzzTest = NULL;
enum {
DeepState_InputSize = 8192
};
/* Byte buffer that will contain symbolic data that is used to supply requests
* for symbolic values (e.g. `int`s). */
static volatile uint8_t DeepState_Input[DeepState_InputSize];
/* Index into the `DeepState_Input` array that tracks how many input bytes have
* been consumed. */
static uint32_t DeepState_InputIndex = 0;
/* Initialize global input buffer and index. */
volatile uint8_t DeepState_Input[DeepState_InputSize] = {};
uint32_t DeepState_InputIndex = 0;
/* Jump buffer for returning to `DeepState_Run`. */
jmp_buf DeepState_ReturnToRun = {};