• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / sinter / 12590773456

03 Jan 2025 12:32AM UTC coverage: 91.069%. Remained the same
12590773456

push

github

web-flow
Bump nanoid from 3.3.7 to 3.3.8 in /devices/wasm/web (#25)

Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

2121 of 2329 relevant lines covered (91.07%)

5753650.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.48
/vm/include/sinter/stack.h
1
#ifndef SINTER_STACK_H
2
#define SINTER_STACK_H
3

4
#include "config.h"
5

6
#include <stdint.h>
7

8
#include "nanbox.h"
9
#include "heap_obj.h"
10
#include "debug.h"
11
#include "debug_heap.h"
12

13
#ifdef __cplusplus
14
extern "C" {
15
#endif
16

17
extern sinanbox_t sistack[SINTER_STACK_ENTRIES];
18

19
// (Inclusive) Bottom of the current function's operand stack, as an index into
20
// sistack.
21
extern sinanbox_t *sistack_bottom;
22
// (Exclusive) Limit of the current function's operand stack, as an index into
23
// sistack.
24
extern sinanbox_t *sistack_limit;
25
// Index of the next empty entry of the current function's operand stack.
26
extern sinanbox_t *sistack_top;
27

28
SINTER_INLINE void sistack_push_force(sinanbox_t entry) {
309,054✔
29
#if SINTER_DEBUG_LOGLEVEL >= 2
30
  SIDEBUG("Pushed onto stack: ");
309,054✔
31
  SIDEBUG_NANBOX(entry);
309,054✔
32
  SIDEBUG("\n");
309,054✔
33
#endif
34

35
  *(sistack_top++) = entry;
309,054✔
36
}
309,054✔
37

38
SINTER_INLINE void sistack_push(sinanbox_t entry) {
283,471✔
39
#ifndef SINTER_DISABLE_CHECKS
40
  if (sistack_top >= sistack_limit) {
283,471✔
41
    sifault(sinter_fault_stack_overflow);
×
42
    return;
43
  }
44
#endif
45

46
  sistack_push_force(entry);
283,471✔
47
}
48

49
SINTER_INLINE __attribute__((warn_unused_result)) sinanbox_t sistack_pop(void) {
262,758✔
50
#ifndef SINTER_DISABLE_CHECKS
51
  if (sistack_top <= sistack_bottom) {
262,758✔
52
    sifault(sinter_fault_stack_underflow);
×
53
  }
54
#endif
55

56
#if SINTER_DEBUG_LOGLEVEL >= 2
57
  SIDEBUG("Popped from stack: ");
262,758✔
58
  SIDEBUG_NANBOX(*(sistack_top - 1));
262,758✔
59
  SIDEBUG("\n");
262,758✔
60
#endif
61
  return *(--sistack_top);
262,758✔
62
}
63

64
SINTER_INLINE sinanbox_t sistack_peek(unsigned int index) {
28,606✔
65
  sinanbox_t *v = sistack_top - 1 - index;
28,606✔
66
#ifndef SINTER_DISABLE_CHECKS
67
  if (v < sistack_bottom) {
28,606✔
68
    sifault(sinter_fault_stack_underflow);
×
69
  }
70
#endif
71

72
  return *v;
28,606✔
73
}
74

75
SINTER_INLINE void sistack_new(unsigned int size, const opcode_t *return_address, siheap_env_t *return_env) {
25,583✔
76
  siheap_frame_t *frame = siframe_new();
25,583✔
77
  frame->return_address = return_address;
25,583✔
78
  frame->saved_env = return_env;
25,583✔
79
  frame->saved_stack_bottom = sistack_bottom;
25,583✔
80
  frame->saved_stack_limit = sistack_limit;
25,583✔
81
  frame->saved_stack_top = sistack_top;
25,583✔
82

83
  sistack_push_force(SIHEAP_PTRTONANBOX(frame));
25,583✔
84

85
  sistack_bottom = sistack_top;
25,583✔
86
  sistack_limit = sistack_bottom + size;
25,583✔
87
}
25,583✔
88

89
SINTER_INLINE void sistack_destroy(const opcode_t **return_address, siheap_env_t **return_env) {
25,581✔
90
  while (sistack_top > sistack_bottom) {
25,634✔
91
    sinanbox_t v = sistack_pop();
53✔
92
    siheap_derefbox(v);
53✔
93
  }
94

95
  siheap_frame_t *frame = (siheap_frame_t *) SIHEAP_NANBOXTOPTR(*(sistack_bottom - 1));
25,581✔
96
  assert(frame->header.type == sitype_frame);
25,581✔
97

98
  *return_address = frame->return_address;
25,581✔
99
  *return_env = frame->saved_env;
25,581✔
100
  sistack_bottom = frame->saved_stack_bottom;
25,581✔
101
  sistack_limit = frame->saved_stack_limit;
25,581✔
102
  sistack_top = frame->saved_stack_top;
25,581✔
103

104
  siheap_deref(frame);
25,581✔
105
}
25,581✔
106

107
void sistack_init(void);
108

109
#ifdef __cplusplus
110
}
111
#endif
112

113
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc