| 319 | } |
| 320 | |
| 321 | static void push_enclosing_class(JavaLSPContext *ctx, const char *class_qn) { |
| 322 | if (ctx->enclosing_class_depth >= ctx->enclosing_class_cap) { |
| 323 | int new_cap = ctx->enclosing_class_cap == 0 ? 8 : ctx->enclosing_class_cap * 2; |
| 324 | const char **arr = |
| 325 | (const char **)cbm_arena_alloc(ctx->arena, (size_t)new_cap * sizeof(*arr)); |
| 326 | if (!arr) |
| 327 | return; |
| 328 | if (ctx->enclosing_class_depth > 0) { |
| 329 | memcpy(arr, ctx->enclosing_class_stack, |
| 330 | (size_t)ctx->enclosing_class_depth * sizeof(*arr)); |
| 331 | } |
| 332 | ctx->enclosing_class_stack = arr; |
| 333 | ctx->enclosing_class_cap = new_cap; |
| 334 | } |
| 335 | ctx->enclosing_class_stack[ctx->enclosing_class_depth++] = class_qn; |
| 336 | } |
| 337 | |
| 338 | static void pop_enclosing_class(JavaLSPContext *ctx) { |
| 339 | if (ctx->enclosing_class_depth > 0) |
no test coverage detected