Skip to content

Commit a59752b

Browse files
author
Y_Less
committed
Use the top of the heap, not the bottom.
1 parent 78be950 commit a59752b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/amxref.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ const char *AMXRef::GetString(uint32_t offset) const {
160160
}
161161

162162
cell AMXRef::GetStackSpaceLeft() const {
163-
return GetStk() - GetHlw();
163+
return GetStk() - GetHea();
164164
}
165165

166166
bool AMXRef::CheckStack() const {
167-
return GetStk() >= GetHlw() && GetStk() <= GetStp();
167+
return GetStk() >= GetHea() && GetStk() <= GetStp();
168168
}
169169

170170
void AMXRef::PushStack(cell value) {

src/amxstacktrace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ AMXStackTrace GetAMXStackTrace(AMXRef amx,
185185
int max_depth) {
186186
// Use a fake frame, hopefully without clobbering anything in silly code.
187187
cell stk = amx.GetStk();
188-
cell hlw = amx.GetHlw();
188+
cell hlw = amx.GetHea();
189189
if (amx.CheckStack() && amx.GetStackSpaceLeft() >= (2 * sizeof(cell))) {
190190
amx.SetStk(hlw + (2 * sizeof(cell)));
191191
amx.PushStack(cip);

0 commit comments

Comments
 (0)