this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

we got something with asan also update sdl-gpus glew is neccessary

alice 0dd96886 46fd0f5f

+124 -59
+2 -2
CMakeLists.txt
··· 107 107 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") 108 108 endif() 109 109 110 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0") 111 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") 110 + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fsanitize=address -fno-omit-frame-pointer") 111 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fsanitize=address -fno-omit-frame-pointer") 112 112 113 113 set(THIRDPARTY_DIR ${CMAKE_SOURCE_DIR}/vendor) 114 114 set(DEMO_CARTS_IN ${CMAKE_SOURCE_DIR}/demos)
+118 -57
src/studio/screens/console.c
··· 287 287 char* replaced1 = str_replace(text, "$LANG_NAMES$", langnames); 288 288 char* replaced2 = str_replace(replaced1, "$LANG_EXTENSIONS$", langextensions); 289 289 char* replaced3 = str_replace(replaced2, "$LANG_NAMES_PIPE$", langnamespipe); 290 - free(replaced2); 291 - free(replaced1); 290 + 291 + // alice was here 292 + // free(replaced2); 293 + // free(replaced1); 292 294 return replaced3; 293 295 } 294 296 ··· 583 585 584 586 clearSelection(console); 585 587 586 - FREE(console->desc->src); 587 - FREE(console->desc->command); 588 - FREE(console->desc->params); 588 + // alice was here 589 + // FREE(console->desc->src); 590 + // FREE(console->desc->command); 591 + // FREE(console->desc->params); 589 592 590 593 memset(console->desc, 0, sizeof(CommandDesc)); 591 594 } ··· 820 823 printFront(console, console->rom.name); 821 824 printBack(console, " loaded!\n"); 822 825 823 - free(data); 826 + // alice was here 827 + // free(data); 824 828 } 825 829 826 830 static void onCartLoaded(Console* console, const char* name, const char* section) ··· 895 899 if (loadByHashData->callback) 896 900 loadByHashData->callback(loadByHashData->calldata); 897 901 898 - FREE(loadByHashData->name); 899 - FREE(loadByHashData->section); 900 - FREE(loadByHashData); 902 + // alice was here 903 + // FREE(loadByHashData->name); 904 + // FREE(loadByHashData->section); 905 + // FREE(loadByHashData); 901 906 902 907 commandDone(console); 903 908 } ··· 1328 1333 *tmpCommonPrefix = 0; 1329 1334 } 1330 1335 1336 + // Calculate remaining buffer space 1337 + size_t currentLength = strlen(data->options); 1338 + size_t availableSpace = CONSOLE_BUFFER_SCREEN - currentLength - 1; // -1 for null terminator 1339 + 1340 + if (strlen(option) + 1 > availableSpace) { // +1 for the space character 1341 + printf("ASAN Error: Not enough buffer space to add option: %s\n", option); 1342 + return; // Early return to prevent buffer overflow 1343 + } 1344 + 1345 + // Debugging information 1346 + printf("ASAN Buffer space before adding: %zu\n", availableSpace); 1347 + 1331 1348 // The option matches the incomplete word, add it to the list. 1332 - strncat(data->options, option, CONSOLE_BUFFER_SCREEN); 1333 - strncat(data->options, " ", CONSOLE_BUFFER_SCREEN); 1349 + strncat(data->options, option, availableSpace); 1350 + strncat(data->options, " ", availableSpace - strlen(option)); 1351 + 1352 + // Debugging information 1353 + printf("ASAN Option added successfully: %s\n", option); 1354 + 1355 + // The option matches the incomplete word, add it to the list. 1356 + // alice was here 1357 + // ASAN TELLS ME THIS IS THE ISSUE 1358 + // strncat(data->options, option, CONSOLE_BUFFER_SCREEN); 1359 + // strncat(data->options, " ", CONSOLE_BUFFER_SCREEN); 1334 1360 } 1335 1361 } 1336 1362 ··· 1457 1483 finishTabComplete(tabCompleteData); 1458 1484 1459 1485 // Free the pointers here 1460 - free(tabCompleteData->options); 1461 - free(tabCompleteData->commonPrefix); 1486 + // alice was here 1487 + // free(tabCompleteData->options); 1488 + // free(tabCompleteData->commonPrefix); 1462 1489 1463 - free(tabCompleteData); 1490 + // free(tabCompleteData); 1464 1491 } 1465 1492 1466 1493 printf("DATA WAS NOT NULL IN FINISHTABCOMPLETEDATA\n"); ··· 1600 1627 } 1601 1628 else printFront(console, item->name); 1602 1629 1603 - free((void*)item->name); 1630 + // alice was here 1631 + // free((void*)item->name); 1604 1632 } 1605 1633 1606 1634 if (data->count == 0) ··· 1609 1637 printFront(console, "DEMO"); 1610 1638 printBack(console, " command to install demo carts"); 1611 1639 } 1612 - else free(data->items); 1640 + 1641 + // alice was here 1642 + // else free(data->items); 1613 1643 1614 1644 printLine(console); 1615 1645 commandDone(console); 1616 1646 1617 - free(ctx); 1647 + // alice was here 1648 + // free(ctx); 1618 1649 } 1619 1650 1620 1651 typedef struct ··· 1634 1665 } 1635 1666 else printBack(console, "\ndir doesn't exist"); 1636 1667 1637 - free(changeDirData->name); 1638 - free(changeDirData); 1668 + // alice was here 1669 + // free(changeDirData->name); 1670 + // free(changeDirData); 1639 1671 1640 1672 commandDone(console); 1641 1673 } ··· 2291 2323 case net_get_error: 2292 2324 printError(console, "file downloading error :("); 2293 2325 commandDone(console); 2294 - free(exportData); 2326 + 2327 + // alice was here 2328 + // free(exportData); 2295 2329 break; 2296 2330 default: 2297 2331 break; ··· 2311 2345 2312 2346 char filename[TICNAME_MAX]; 2313 2347 strcpy(filename, exportData->filename); 2314 - free(exportData); 2348 + // alice was here 2349 + // free(exportData); 2315 2350 2316 2351 s32 size = data->done.size; 2317 2352 ··· 2322 2357 2323 2358 onFileExported(console, filename, (buf = embedCart(console, data->done.data, &size)) && fs_write(path, buf, size)); 2324 2359 chmod(path, DEFAULT_CHMOD); 2325 - 2326 - if (buf) 2327 - free(buf); 2360 + 2361 + // alice was here 2362 + // if (buf) 2363 + // free(buf); 2328 2364 } 2329 2365 break; 2330 2366 default: ··· 2368 2404 2369 2405 char filename[TICNAME_MAX]; 2370 2406 strcpy(filename, exportData->filename); 2371 - free(exportData); 2407 + // alice was here 2408 + // free(exportData); 2372 2409 2373 2410 const char* zipPath = tic_fs_path(console->fs, filename); 2374 2411 bool errorOccurred = !fs_write(zipPath, data->done.data, data->done.size); ··· 2645 2682 { 2646 2683 console->config->save(console->config); 2647 2684 studioRomSaved(console->studio); 2648 - free(buffer); 2685 + // alice was here 2686 + // free(buffer); 2649 2687 return CART_SAVE_OK; 2650 2688 } 2651 2689 else ··· 2692 2730 if(title) 2693 2731 { 2694 2732 drawShadowText(tic, title, 0, 0, tic_color_white, Scale); 2695 - free(title); 2733 + // alice was here 2734 + // free(title); 2696 2735 } 2697 2736 2698 2737 char* author = tic_tool_metatag(tic->cart.code.data, "author", comment); ··· 2701 2740 char buf[TICNAME_MAX]; 2702 2741 snprintf(buf, sizeof buf, "by %s", author); 2703 2742 drawShadowText(tic, buf, 0, Row, tic_color_grey, Scale); 2704 - free(author); 2743 + // alice was here 2744 + // free(author); 2705 2745 } 2706 2746 2707 2747 u32* ptr = img.values + PaddingTop * CoverWidth + PaddingLeft; ··· 2715 2755 2716 2756 cover = png_write(img, (png_buffer){NULL, 0}); 2717 2757 2718 - free(img.data); 2758 + // alice was here 2759 + // free(img.data); 2719 2760 } 2720 2761 2721 2762 png_buffer zip = png_create(sizeof(tic_cartridge)); ··· 2724 2765 png_buffer cart = png_create(sizeof(tic_cartridge)); 2725 2766 cart.size = tic_cart_save(&tic->cart, cart.data); 2726 2767 zip.size = tic_tool_zip(zip.data, zip.size, cart.data, cart.size); 2727 - free(cart.data); 2768 + // alice was here 2769 + // free(cart.data); 2728 2770 } 2729 2771 2730 2772 png_buffer result = png_encode(cover, zip); 2731 - free(zip.data); 2732 - free(cover.data); 2773 + // alice was here 2774 + // free(zip.data); 2775 + // free(cover.data); 2733 2776 2734 2777 buffer = result.data; 2735 2778 size = result.size; ··· 2754 2797 } 2755 2798 } 2756 2799 2757 - free(buffer); 2800 + // alice was here 2801 + // free(buffer); 2758 2802 } 2759 2803 } 2760 2804 else if (strlen(console->rom.name)) ··· 3534 3578 3535 3579 TabCompleteData newTabCompleteData(Console* console, char* incompleteWord) { 3536 3580 TabCompleteData data = { console, .incompleteWord = incompleteWord }; 3581 + printf("BEFORE MALLOC1 IN newTabCompleteData\n"); 3537 3582 data.options = malloc(CONSOLE_BUFFER_SCREEN); 3583 + printf("BEFORE MALLOC2 IN newTabCompleteData\n"); 3538 3584 data.commonPrefix = malloc(CONSOLE_BUFFER_SCREEN); 3539 3585 3540 3586 // Check for malloc failure ··· 3542 3588 printf("OOPSIE WHOOPSIE WE MADE A FUCKSIE WUCKSIE\n"); 3543 3589 // Handle error, for example, by logging and exiting or by setting a default value 3544 3590 // For simplicity, we'll just free any successful allocation and return an empty struct 3545 - free(data.options); // Safe to call free on NULL 3546 - free(data.commonPrefix); 3591 + // alice was here 3592 + // free(data.options); // Safe to call free on NULL 3593 + // free(data.commonPrefix); 3547 3594 return (TabCompleteData){0}; // Return an empty struct or handle error appropriately 3548 3595 } 3549 3596 ··· 3641 3688 TabCompleteData data = newTabCompleteData(console, param); 3642 3689 printf("TabCompleteData data is: %p\n", (void*)&data); 3643 3690 Commands[i].tabComplete1(&data); 3691 + // alice added 3692 + break; 3644 3693 } 3645 3694 } 3646 3695 } ··· 3664 3713 finishTabComplete(&data); 3665 3714 printf("Finished tab completion\n"); 3666 3715 } 3667 - printf("Scrolling console\n"); 3668 - scrollConsole(console); 3716 + // printf("Scrolling console FROM processConsoleTab\n"); 3717 + // scrollConsole(console); 3669 3718 } 3670 3719 3671 3720 static void toUpperStr(char* str) ··· 3686 3735 consolePrint(console, "\n---=== COMMAND ===---\n", tic_color_green); 3687 3736 char* helpReplaced = replaceHelpTokens(cmd->help); 3688 3737 printBack(console, helpReplaced); 3689 - free(helpReplaced); 3738 + // alice was here 3739 + // free(helpReplaced); 3690 3740 3691 3741 if(cmd->usage) 3692 3742 { 3693 3743 printFront(console, "\n\nusage: "); 3694 3744 char* usageReplaced = replaceHelpTokens(cmd->usage); 3695 3745 printBack(console, usageReplaced); 3696 - free(usageReplaced); 3746 + // alice was here 3747 + // free(usageReplaced); 3697 3748 } 3698 3749 3699 3750 printLine(console); ··· 3844 3895 char* rowReplaced = replaceHelpTokens(row->info); 3845 3896 sprintf(buf, "%-" DEF2STR(OFFSET) "s%s\n", row->section, rowReplaced); 3846 3897 consolePrintOffset(console, buf, tic_color_grey, OFFSET); 3847 - free(rowReplaced); 3898 + // alice was here 3899 + // free(rowReplaced); 3848 3900 #undef OFFSET 3849 3901 } 3850 3902 } ··· 4081 4133 { 4082 4134 if(luaL_loadstring(lua, (char*)script) == LUA_OK && lua_pcall(lua, 0, LUA_MULTRET, 0) == LUA_OK) 4083 4135 { 4084 - free(script); 4136 + // alice was here 4137 + // free(script); 4085 4138 return lua; 4086 4139 } 4087 4140 else lua_close(lua); 4088 4141 } 4089 4142 4090 - free(script); 4143 + // alice was here 4144 + // free(script); 4091 4145 } 4092 4146 4093 4147 return NULL; ··· 4201 4255 if (text) 4202 4256 { 4203 4257 tic_sys_clipboard_set(text); 4204 - free(text); 4258 + // alice was here 4259 + // free(text); 4205 4260 clearSelection(console); 4206 4261 } 4207 4262 } ··· 4222 4277 *dst++ = *src; 4223 4278 4224 4279 insertInputText(console, text); 4225 - free(text); 4280 + 4281 + // alice was here 4282 + // free(text); 4226 4283 4227 4284 tic_sys_clipboard_free(clipboard); 4228 4285 } ··· 4295 4352 { 4296 4353 insertInputText(console, text); 4297 4354 tic_sys_clipboard_set(text); 4298 - free(text); 4355 + // alice was here 4356 + // free(text); 4299 4357 } 4300 4358 else 4301 4359 copyFromClipboard(console); ··· 4578 4636 if(cart) 4579 4637 { 4580 4638 memcpy(&tic->cart, cart, sizeof(tic_cartridge)); 4581 - free(cart); 4639 + // alice was here 4640 + // free(cart); 4582 4641 done = true; 4583 4642 } 4584 4643 } ··· 4726 4785 4727 4786 void freeConsole(Console* console) 4728 4787 { 4729 - free(console->text); 4730 - free(console->color); 4788 + return; 4789 + // alice was here 4790 + // free(console->text); 4791 + // free(console->color); 4731 4792 4732 - if(console->history.items) 4733 - { 4734 - for(char **ptr = console->history.items, **end = ptr + console->history.size; ptr < end; ptr++) 4735 - free(*ptr); 4793 + // if(console->history.items) 4794 + // { 4795 + // for(char **ptr = console->history.items, **end = ptr + console->history.size; ptr < end; ptr++) 4796 + // free(*ptr); 4736 4797 4737 - free(console->history.items); 4738 - } 4798 + // free(console->history.items); 4799 + // } 4739 4800 4740 - FREE(console->commands.items); 4741 - free(console->desc); 4742 - free(console); 4801 + // FREE(console->commands.items); 4802 + // free(console->desc); 4803 + // free(console); 4743 4804 }
+4
src/studio/screens/start.c
··· 30 30 #include <unistd.h> 31 31 #endif 32 32 33 + #if defined(__APPLE__) 34 + #include <mach-o/dyld.h> 35 + #endif 36 + 33 37 static void reset(Start* start) 34 38 { 35 39 u8* tile = (u8*)start->tic->ram->tiles.data;