From ce38cb6b1dff0d81e9d8a99fc3411f55762b20e7 Mon Sep 17 00:00:00 2001 From: Giovanni Beltrame Date: Mon, 15 Jun 2020 23:57:04 -0400 Subject: [PATCH] Remove return values of init and step from the stack --- src/buzz_update.cpp | 3 ++- src/buzz_utility.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/buzz_update.cpp b/src/buzz_update.cpp index 3f2f982..a03f214 100644 --- a/src/buzz_update.cpp +++ b/src/buzz_update.cpp @@ -488,6 +488,7 @@ void update_routine() if (*(int*)updater->mode == CODE_RUNNING) { buzzvm_function_call(VM, "updated_no_bct", 0); + buzzvm_pop(VM); // Pop return value // Check for update if (check_update()) { @@ -738,4 +739,4 @@ Patch_packets_received_counter,Patch_request_packets_received,Patch_packets_sent << old_byte_code_size << "," << *(size_t*)updater->bcode_size << "," << *(size_t*)updater->patch_size << "," << (int)*(uint8_t*)updater->update_no << "," << (int)packet_id_; }*/ -} \ No newline at end of file +} diff --git a/src/buzz_utility.cpp b/src/buzz_utility.cpp index 15ab3cf..87fdd60 100644 --- a/src/buzz_utility.cpp +++ b/src/buzz_utility.cpp @@ -397,6 +397,8 @@ int buzz_update_set(uint8_t* UP_BO_BUF, const char* bdbg_filename, size_t bcode_ ROS_ERROR("Error in calling init, VM state : %i", VM->state); return 0; } + // Pop the init return value + buzzvm_pop(VM); // All OK return 1; } @@ -457,6 +459,8 @@ int buzz_update_init_test(uint8_t* UP_BO_BUF, const char* bdbg_filename, size_t ROS_ERROR("Error in calling init, VM state : %i", VM->state); return 0; } + // Pop init return value + buzzvm_pop(VM); // All OK return 1; } @@ -501,6 +505,8 @@ void buzz_script_step() ROS_ERROR("%s: execution terminated abnormally: %s", BO_FNAME, buzz_error_info()); buzzvm_dump(VM); } + // Pop the step return value + buzzvm_pop(VM); } void buzz_script_destroy() @@ -545,6 +551,8 @@ int update_step_test() buzzuav_closures::buzzuav_update_flight_status(VM); int a = buzzvm_function_call(VM, "step", 0); + // Pop step return value + buzzvm_pop(VM); if (a != BUZZVM_STATE_READY) {