feat: bux test runner, bitwise-not parsing, stdlib discovery hardening\n\n- Add 'bux test' runner: discovers tests/*.bux, builds each in a temp package, runs and reports PASS/FAIL.\n- Fix unary ~ parsing and C emission in self-hosted compiler.\n- Harden stdlib discovery (require Fs.bux, avoid system /lib) and lstat in directory traversal.\n- Selfhost loop passes: buxc2 builds src/ and produces identical C output + stripped binary.\n- Update PLAN.md with completed milestones.
This commit is contained in:
+2
-2
@@ -675,7 +675,7 @@ static int bux_count_files_recursive(const char* dir, const char* ext, size_t ex
|
||||
if (!path) continue;
|
||||
snprintf(path, path_len, "%s/%s", dir, entry->d_name);
|
||||
struct stat st;
|
||||
if (stat(path, &st) == 0) {
|
||||
if (lstat(path, &st) == 0) {
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
count += bux_count_files_recursive(path, ext, ext_len);
|
||||
} else {
|
||||
@@ -702,7 +702,7 @@ static int bux_collect_files_recursive(const char* dir, const char* ext, size_t
|
||||
if (!path) continue;
|
||||
snprintf(path, path_len, "%s/%s", dir, entry->d_name);
|
||||
struct stat st;
|
||||
if (stat(path, &st) == 0) {
|
||||
if (lstat(path, &st) == 0) {
|
||||
if (S_ISDIR(st.st_mode)) {
|
||||
idx = bux_collect_files_recursive(path, ext, ext_len, result, idx);
|
||||
free(path);
|
||||
|
||||
Reference in New Issue
Block a user