Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
  • Loading branch information
Alan-Jowett committed May 21, 2024
1 parent aa75a5f commit 35c0bc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion vm/inc/ubpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ extern "C"
int
ubpf_set_instruction_limit(struct ubpf_vm* vm, uint32_t limit, uint32_t* previous_limit);


/**
* @brief Enable or disable undefined behavior checks. Undefined behavior includes
* reading from uninitialized memory or using uninitialized registers.
Expand Down
8 changes: 4 additions & 4 deletions vm/ubpf_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,7 @@ ubpf_validate_shadow_register(const struct ubpf_vm* vm, uint16_t* shadow_registe

// Mark r1-r5 as uninitialized.
*shadow_registers &= ~0x3e;
}
else if (inst.src == 1) {
} else if (inst.src == 1) {
// Do nothing, register state will be handled by the callee on return.
}
}
Expand Down Expand Up @@ -615,7 +614,7 @@ ubpf_exec_ex(
void* external_dispatcher_cookie = mem;
void* shadow_stack = NULL;

struct ebpf_inst previous_inst = { .opcode = 0};
struct ebpf_inst previous_inst = {.opcode = 0};

if (!insts) {
/* Code must be loaded before we can execute */
Expand Down Expand Up @@ -669,7 +668,8 @@ ubpf_exec_ex(
if (previous_inst.opcode != 0 && !(previous_inst.opcode == EBPF_OP_CALL && previous_inst.src == 1)) {
// Previous instruction wasn't a call to this instruction, so behavior is undefined.
if (vm->undefined_behavior_check_enabled) {
vm->error_printf(stderr, "Error: Call to local function at pc %d is not from a call instruction.\n", pc);
vm->error_printf(
stderr, "Error: Call to local function at pc %d is not from a call instruction.\n", pc);
return_value = -1;
goto cleanup;
}
Expand Down

0 comments on commit 35c0bc6

Please sign in to comment.