Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
62 lines
1010 B
C++
62 lines
1010 B
C++
// C++ CFG hazard fixture (#2195 U2). Exercises the C core plus the C++-only
|
|
// constructs: try/catch, throw, range-for, and lambdas.
|
|
|
|
#include <vector>
|
|
#include <stdexcept>
|
|
|
|
int if_else(int x) {
|
|
int r;
|
|
if (x > 0) {
|
|
r = 1;
|
|
} else {
|
|
r = -1;
|
|
}
|
|
return r;
|
|
}
|
|
|
|
int try_catch(int x) {
|
|
int result = 0;
|
|
try {
|
|
if (x < 0) {
|
|
throw std::runtime_error("negative");
|
|
}
|
|
result = compute(x);
|
|
} catch (const std::exception &e) {
|
|
result = -1;
|
|
handle(e);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
void throw_no_try(int x) {
|
|
if (x < 0) {
|
|
throw std::runtime_error("bad");
|
|
}
|
|
proceed(x);
|
|
}
|
|
|
|
int range_for(const std::vector<int> &xs) {
|
|
int sum = 0;
|
|
for (int x : xs) {
|
|
sum = sum + x;
|
|
}
|
|
return sum;
|
|
}
|
|
|
|
int with_lambda(int n) {
|
|
auto doubler = [](int v) {
|
|
if (v > 0) {
|
|
return v * 2;
|
|
}
|
|
return 0;
|
|
};
|
|
return doubler(n);
|
|
}
|
|
|
|
// Non-terminating server loop — EXIT must stay reverse-reachable for the CDG pass.
|
|
void run_forever() {
|
|
while (true) {
|
|
poll();
|
|
}
|
|
}
|