Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ xcheck_add_c_compiler_flag(-Wno-unused-parameter)
xcheck_add_c_compiler_flag(-Wno-unused-but-set-variable)
xcheck_add_c_compiler_flag(-Wno-array-bounds)
xcheck_add_c_compiler_flag(-Wno-format-truncation)
xcheck_add_c_compiler_flag(-Wno-format-zero-length)
xcheck_add_c_compiler_flag(-funsigned-char)

# ClangCL is command line compatible with MSVC, so 'MSVC' is set.
Expand Down
2 changes: 1 addition & 1 deletion cutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extern "C" {
#elif defined(_WIN32)
#include <windows.h>
#endif
#if !defined(_WIN32)
#if !defined(_WIN32) && !defined(EMSCRIPTEN) && !defined(__wasi__)
#include <errno.h>
#include <pthread.h>
#endif
Expand Down
7 changes: 7 additions & 0 deletions libbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,13 @@ static int __bf_div(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec,
slimb_t d;

na = n + nb;

#if LIMB_LOG2_BITS == 6
if (na >= (SIZE_MAX / sizeof(limb_t)) - 1) {
return BF_ST_MEM_ERROR; /* Return memory error status */
}
#endif

taba = bf_malloc(s, (na + 1) * sizeof(limb_t));
if (!taba)
goto fail;
Expand Down
14 changes: 8 additions & 6 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define NO_TM_GMTOFF
#endif

#if !defined(EMSCRIPTEN) && !defined(__wasi__)
#if !defined(EMSCRIPTEN) && !defined(__wasi__) && !defined(__STDC_NO_ATOMICS__)
#include "quickjs-c-atomics.h"
#define CONFIG_ATOMICS
#endif
Expand Down Expand Up @@ -6673,7 +6673,7 @@ static void build_backtrace(JSContext *ctx, JSValue error_obj,
}
done:
if (has_prepare) {
int j = 0;
int j = 0, k;
stack = JS_NewArray(ctx);
if (JS_IsException(stack)) {
stack = JS_NULL;
Expand All @@ -6689,7 +6689,7 @@ static void build_backtrace(JSContext *ctx, JSValue error_obj,
}
}
// Clear the csd's we didn't use in case of error.
for (int k = j; k < i; k++) {
for (k = j; k < i; k++) {
JS_FreeValue(ctx, csd[k].filename);
JS_FreeValue(ctx, csd[k].func);
JS_FreeValue(ctx, csd[k].func_name);
Expand Down Expand Up @@ -34643,7 +34643,7 @@ static JSString *JS_ReadString(BCReaderState *s)
}
#ifdef DUMP_READ_OBJECT
if (check_dump_flag(s->ctx->rt, DUMP_READ_OBJECT)) {
bc_read_trace(s, ""); // hex dump and indentation
bc_read_trace(s, "%s", ""); // hex dump and indentation
JS_DumpString(s->ctx->rt, p);
printf("\n");
}
Expand Down Expand Up @@ -34703,7 +34703,7 @@ static int JS_ReadFunctionBytecode(BCReaderState *s, JSFunctionBytecode *b,
const uint8_t *save_ptr = s->ptr;
s->ptr = s->ptr_last + len;
s->level -= 4;
bc_read_trace(s, ""); // hex dump + indent
bc_read_trace(s, "%s", ""); // hex dump + indent
dump_single_byte_code(s->ctx, bc_buf + pos, b,
s->ptr - s->buf_start - len);
s->level += 4;
Expand Down Expand Up @@ -49847,7 +49847,9 @@ static struct {
};

static BOOL string_get_tzabbr(const uint8_t *sp, int *pp, int *offset) {
for (size_t i = 0; i < countof(js_tzabbr); i++) {
size_t i;

for (i = 0; i < countof(js_tzabbr); i++) {
if (string_match(sp, pp, js_tzabbr[i].name)) {
*offset = js_tzabbr[i].offset;
return TRUE;
Expand Down
Loading