Skip to content

Commit

Permalink
Remove duplicated do_start, return the recturn code from payload.rpx
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Dec 30, 2021
1 parent 9aa4f34 commit 98e3c08
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ extern "C" int _start(int argc, char **argv) {
auto heap = (MEMExpHeap *) mem2_heap_handle;
MEMExpHeapBlock *memory_start = heap->usedList.tail;

int res = do_start(argc, argv);

uint32_t entrypoint = do_start(argc, argv);

// free leaked memory
Expand All @@ -105,8 +103,7 @@ extern "C" int _start(int argc, char **argv) {
__fini_wut();

if (entrypoint > 0) {
((int (*)(int, char **)) entrypoint)(argc, argv);
_Exit(0);
return ((int (*)(int, char **)) entrypoint)(argc, argv);
}

return -1;
Expand Down

0 comments on commit 98e3c08

Please sign in to comment.