Skip to content

Commit 5066e77

Browse files
committed
refactor(vm): marking push methods as noexcept since out of bound writes are handled in safeRun
1 parent ddb19f7 commit 5066e77

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/Ark/VM/VM.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,23 @@ namespace Ark
272272
* @param value
273273
* @param context
274274
*/
275-
inline void push(const Value& value, internal::ExecutionContext& context);
275+
inline void push(const Value& value, internal::ExecutionContext& context) noexcept;
276276

277277
/**
278278
* @brief Push a value on the stack
279279
*
280280
* @param value
281281
* @param context
282282
*/
283-
inline void push(Value&& value, internal::ExecutionContext& context);
283+
inline void push(Value&& value, internal::ExecutionContext& context) noexcept;
284284

285285
/**
286286
* @brief Push a value on the stack as a reference
287287
*
288288
* @param valptr
289289
* @param context
290290
*/
291-
inline void push(Value* valptr, internal::ExecutionContext& context);
291+
inline void push(Value* valptr, internal::ExecutionContext& context) noexcept;
292292

293293
/**
294294
* @brief Pop a value from the stack and resolve it if possible, then return it

include/Ark/VM/VM.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ inline Value* VM::peekAndResolveAsPtr(internal::ExecutionContext& context)
185185
return &m_undefined_value;
186186
}
187187

188-
inline void VM::push(const Value& value, internal::ExecutionContext& context)
188+
inline void VM::push(const Value& value, internal::ExecutionContext& context) noexcept
189189
{
190190
context.stack[context.sp] = value;
191191
++context.sp;
192192
}
193193

194-
inline void VM::push(Value&& value, internal::ExecutionContext& context)
194+
inline void VM::push(Value&& value, internal::ExecutionContext& context) noexcept
195195
{
196196
context.stack[context.sp] = std::move(value);
197197
++context.sp;
198198
}
199199

200-
inline void VM::push(Value* valptr, internal::ExecutionContext& context)
200+
inline void VM::push(Value* valptr, internal::ExecutionContext& context) noexcept
201201
{
202202
context.stack[context.sp].m_type = ValueType::Reference;
203203
context.stack[context.sp].m_value = valptr;

0 commit comments

Comments
 (0)