mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 21:32:05 +00:00
fix(postgres) regression (#21466)
### What does this PR do? Fix: https://github.com/oven-sh/bun/issues/21351 Relevant changes: Fix advance to properly cleanup success and failed queries that could be still be in the queue Always ref before executing Use stronger atomics for ref/deref and hasPendingActivity Fallback when thisValue is freed/null/zero and check if vm is being shutdown The bug in --hot in `resolveRopeIfNeeded` Issue is not meant to be fixed in this PR this is a fix for the postgres regression Added assertions so this bug is easier to catch on CI ### How did you verify your code works? Test added --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
Jarred Sumner
parent
fd45273b5a
commit
8bc2449d62
@@ -57,10 +57,14 @@ pub fn NewReaderWrap(
|
||||
pub fn int(this: @This(), comptime Int: type) !Int {
|
||||
var data = try this.read(@sizeOf((Int)));
|
||||
defer data.deinit();
|
||||
if (comptime Int == u8) {
|
||||
return @as(Int, data.slice()[0]);
|
||||
const slice = data.slice();
|
||||
if (slice.len < @sizeOf(Int)) {
|
||||
return error.ShortRead;
|
||||
}
|
||||
return @byteSwap(@as(Int, @bitCast(data.slice()[0..@sizeOf(Int)].*)));
|
||||
if (comptime Int == u8) {
|
||||
return @as(Int, slice[0]);
|
||||
}
|
||||
return @byteSwap(@as(Int, @bitCast(slice[0..@sizeOf(Int)].*)));
|
||||
}
|
||||
|
||||
pub fn peekInt(this: @This(), comptime Int: type) ?Int {
|
||||
|
||||
Reference in New Issue
Block a user