Skip to content

Commit

Permalink
Release 4.0.2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
adonais committed Aug 14, 2023
1 parent dad3ce1 commit 2875b08
Show file tree
Hide file tree
Showing 53 changed files with 603 additions and 191 deletions.
10 changes: 10 additions & 0 deletions plugins/pdfview/np_pdfviewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
#ifndef IDM_SAVE_PLUGIN
#define IDM_SAVE_PLUGIN 260
#endif
#ifndef IDM_FULLSCREEN_PLUGIN
#define IDM_FULLSCREEN_PLUGIN 221
#endif
#ifndef IDM_VIEW_FULLSCREEN
#define IDM_VIEW_FULLSCREEN 42602
#endif
#ifndef IDM_TITLE_PLUGIN
#define IDM_TITLE_PLUGIN 1224
#endif
Expand Down Expand Up @@ -525,6 +531,10 @@ pdf_plugin_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
nphdr.nm.idFrom = (intptr_t)FindWindowEx(hwnd, NULL, NULL, NULL);
return npn_send_notify(hwnd, NPP_DOC_STATUS, OPERATE_NONE, &nphdr);
}
else if (msg == WM_COMMAND && LOWORD(wparam) == IDM_FULLSCREEN_PLUGIN)
{
return npn_send_command(hwnd, IDM_VIEW_FULLSCREEN);
}
else if (msg == WM_COPYDATA)
{
COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lparam;
Expand Down
6 changes: 6 additions & 0 deletions share/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
4.0.2 2023-08-14 adonais
* 变更: 为需要管理员权限的菜单栏添加护盾图标
* 变更: 插件页面支持全屏快捷键
* 修复: 新建文档标签修改后无法自动保存(回归bug)
* 修复: 数据库查询时显示空表列的错误(回归bug)

4.0.1 2023-08-09 adonais
* 新增: 翻新Skylark编辑器菜单栏
* 变更: 状态栏读写按钮也支持插件页面
Expand Down
5 changes: 4 additions & 1 deletion src/3rdparty/libopenssl/include/openssl/dh.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
Expand Down Expand Up @@ -29,6 +29,9 @@ extern "C" {
# ifndef OPENSSL_DH_MAX_MODULUS_BITS
# define OPENSSL_DH_MAX_MODULUS_BITS 10000
# endif
# ifndef OPENSSL_DH_CHECK_MAX_MODULUS_BITS
# define OPENSSL_DH_CHECK_MAX_MODULUS_BITS 32768
# endif

# define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024

Expand Down
3 changes: 2 additions & 1 deletion src/3rdparty/libopenssl/include/openssl/dherr.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Generated by util/mkerr.pl DO NOT EDIT
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
Expand Down Expand Up @@ -30,6 +30,7 @@ int ERR_load_DH_strings(void);
# define DH_F_COMPUTE_KEY 102
# define DH_F_DHPARAMS_PRINT_FP 101
# define DH_F_DH_BUILTIN_GENPARAMS 106
# define DH_F_DH_CHECK 126
# define DH_F_DH_CHECK_EX 121
# define DH_F_DH_CHECK_PARAMS_EX 122
# define DH_F_DH_CHECK_PUB_KEY_EX 123
Expand Down
4 changes: 2 additions & 2 deletions src/3rdparty/libopenssl/include/openssl/opensslv.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ extern "C" {
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
* major minor fix final patch/beta)
*/
# define OPENSSL_VERSION_NUMBER 0x1010115fL
# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1u 30 May 2023"
# define OPENSSL_VERSION_NUMBER 0x1010116fL
# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1v 1 Aug 2023"

/*-
* The macros below are to be used for shared library (.so, .dll, ...)
Expand Down
1 change: 1 addition & 0 deletions src/3rdparty/luajit/dynasm/dasm_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void dasm_setup(Dst_DECL, const void *actionlist)
if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);
for (i = 0; i < D->maxsection; i++) {
D->sections[i].pos = DASM_SEC2POS(i);
D->sections[i].rbuf = D->sections[i].buf - D->sections[i].pos;
D->sections[i].ofs = 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/3rdparty/luajit/dynasm/dasm_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ void dasm_setup(Dst_DECL, const void *actionlist)
if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);
for (i = 0; i < D->maxsection; i++) {
D->sections[i].pos = DASM_SEC2POS(i);
D->sections[i].rbuf = D->sections[i].buf - D->sections[i].pos;
D->sections[i].ofs = 0;
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/3rdparty/luajit/dynasm/dasm_arm64.lua
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,13 @@ map_op = {
tbz_3 = "36000000DTBw|36000000DTBx",
tbnz_3 = "37000000DTBw|37000000DTBx",

-- ARM64e: Pointer authentication codes (PAC).
blraaz_1 = "d63f081fNx",
braa_2 = "d71f0800NDx",
braaz_1 = "d61f081fNx",
pacibsp_0 = "d503237f",
retab_0 = "d65f0fff",

-- Miscellaneous instructions.
-- TODO: hlt, hvc, smc, svc, eret, dcps[123], drps, mrs, msr
-- TODO: sys, sysl, ic, dc, at, tlbi
Expand Down
1 change: 1 addition & 0 deletions src/3rdparty/luajit/dynasm/dasm_mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void dasm_setup(Dst_DECL, const void *actionlist)
if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);
for (i = 0; i < D->maxsection; i++) {
D->sections[i].pos = DASM_SEC2POS(i);
D->sections[i].rbuf = D->sections[i].buf - D->sections[i].pos;
D->sections[i].ofs = 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/3rdparty/luajit/dynasm/dasm_ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void dasm_setup(Dst_DECL, const void *actionlist)
if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);
for (i = 0; i < D->maxsection; i++) {
D->sections[i].pos = DASM_SEC2POS(i);
D->sections[i].rbuf = D->sections[i].buf - D->sections[i].pos;
D->sections[i].ofs = 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/3rdparty/luajit/dynasm/dasm_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ void dasm_setup(Dst_DECL, const void *actionlist)
if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize);
for (i = 0; i < D->maxsection; i++) {
D->sections[i].pos = DASM_SEC2POS(i);
D->sections[i].rbuf = D->sections[i].buf - D->sections[i].pos;
D->sections[i].ofs = 0;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/3rdparty/luajit/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ ifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH)))
DASM_AFLAGS+= -D NO_UNWIND
TARGET_ARCH+= -DLUAJIT_NO_UNWIND
endif
ifneq (,$(findstring LJ_ABI_PAUTH 1,$(TARGET_TESTARCH)))
DASM_AFLAGS+= -D PAUTH
TARGET_ARCH+= -DLJ_ABI_PAUTH=1
endif
DASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subst LJ_ARCH_VERSION ,LJ_ARCH_VERSION_,$(TARGET_TESTARCH))))
ifeq (Windows,$(TARGET_SYS))
DASM_AFLAGS+= -D WIN
Expand Down
9 changes: 6 additions & 3 deletions src/3rdparty/luajit/src/host/buildvm_asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ void emit_asm(BuildCtx *ctx)

fprintf(ctx->fp, "\t.file \"buildvm_%s.dasc\"\n", ctx->dasm_arch);
fprintf(ctx->fp, "\t.text\n");
#if LJ_TARGET_MIPS32 && !LJ_ABI_SOFTFP
fprintf(ctx->fp, "\t.module fp=32\n");
#endif
#if LJ_TARGET_MIPS
fprintf(ctx->fp, "\t.set nomips16\n\t.abicalls\n\t.set noreorder\n\t.set nomacro\n");
#endif
emit_asm_align(ctx, 4);

#if LJ_TARGET_PS3
Expand All @@ -268,9 +274,6 @@ void emit_asm(BuildCtx *ctx)
".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n"
".pad #28\n");
#endif
#endif
#if LJ_TARGET_MIPS
fprintf(ctx->fp, ".set nomips16\n.abicalls\n.set noreorder\n.set nomacro\n");
#endif

for (i = rel = 0; i < ctx->nsym; i++) {
Expand Down
3 changes: 3 additions & 0 deletions src/3rdparty/luajit/src/lib_ffi.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,9 @@ LJLIB_CF(ffi_abi) LJLIB_REC(.)
#if LJ_ABI_WIN
"\003win"
#endif
#if LJ_ABI_PAUTH
"\007pauth"
#endif
#if LJ_TARGET_UWP
"\003uwp"
#endif
Expand Down
3 changes: 2 additions & 1 deletion src/3rdparty/luajit/src/lib_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ LJLIB_CF(jit_util_ircalladdr)
{
uint32_t idx = (uint32_t)lj_lib_checkint(L, 1);
if (idx < IRCALL__MAX) {
setintptrV(L->top-1, (intptr_t)(void *)lj_ir_callinfo[idx].func);
ASMFunction func = lj_ir_callinfo[idx].func;
setintptrV(L->top-1, (intptr_t)(void *)lj_ptr_strip(func));
return 1;
}
return 0;
Expand Down
7 changes: 7 additions & 0 deletions src/3rdparty/luajit/src/lj_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@
#define LJ_ARCH_NAME "arm64"
#define LJ_ARCH_ENDIAN LUAJIT_LE
#endif
#if !defined(LJ_ABI_PAUTH) && defined(__arm64e__)
#define LJ_ABI_PAUTH 1
#endif
#define LJ_TARGET_ARM64 1
#define LJ_TARGET_EHRETREG 0
#define LJ_TARGET_EHRAREG 30
Expand Down Expand Up @@ -603,6 +606,10 @@
#define LJ_SOFTFP (!LJ_ARCH_HASFPU)
#define LJ_SOFTFP32 (LJ_SOFTFP && LJ_32)

#ifndef LJ_ABI_PAUTH
#define LJ_ABI_PAUTH 0
#endif

#if LJ_ARCH_ENDIAN == LUAJIT_BE
#define LJ_LE 0
#define LJ_BE 1
Expand Down
8 changes: 4 additions & 4 deletions src/3rdparty/luajit/src/lj_asm_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ static void asm_gencall(ASMState *as, const CCallInfo *ci, IRRef *args)
uint32_t n, nargs = CCI_XNARGS(ci);
int32_t ofs = 0;
Reg gpr, fpr = REGARG_FIRSTFPR;
if ((void *)ci->func)
emit_call(as, (void *)ci->func);
if (ci->func)
emit_call(as, ci->func);
for (gpr = REGARG_FIRSTGPR; gpr <= REGARG_LASTGPR; gpr++)
as->cost[gpr] = REGCOST(~0u, ASMREF_L);
gpr = REGARG_FIRSTGPR;
Expand Down Expand Up @@ -501,7 +501,7 @@ static void asm_callx(ASMState *as, IRIns *ir)
ci.func = (ASMFunction)(ir_k64(irf)->u64);
} else { /* Need a non-argument register for indirect calls. */
Reg freg = ra_alloc1(as, func, RSET_RANGE(RID_X8, RID_MAX_GPR)-RSET_FIXED);
emit_n(as, A64I_BLR, freg);
emit_n(as, A64I_BLR_AUTH, freg);
ci.func = (ASMFunction)(void *)0;
}
asm_gencall(as, &ci, args);
Expand Down Expand Up @@ -935,7 +935,7 @@ static void asm_hrefk(ASMState *as, IRIns *ir)
emit_nm(as, A64I_CMPx, key, ra_allock(as, k, rset_exclude(allow, key)));
emit_lso(as, A64I_LDRx, key, idx, kofs);
if (bigofs)
emit_opk(as, A64I_ADDx, dest, node, ofs, RSET_GPR);
emit_opk(as, A64I_ADDx, dest, node, ofs, rset_exclude(RSET_GPR, node));
}

static void asm_uref(ASMState *as, IRIns *ir)
Expand Down
2 changes: 1 addition & 1 deletion src/3rdparty/luajit/src/lj_asm_mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -1337,8 +1337,8 @@ static void asm_fload(ASMState *as, IRIns *ir)
}
}
ofs = field_ofs[ir->op2];
lj_assertA(!irt_isfp(ir->t), "bad FP FLOAD");
}
lj_assertA(!irt_isfp(ir->t), "bad FP FLOAD");
emit_tsi(as, mi, dest, idx, ofs);
}

Expand Down
3 changes: 2 additions & 1 deletion src/3rdparty/luajit/src/lj_bcwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ static void bcwrite_knum(BCWriteCtx *ctx, GCproto *pt)
goto save_int;
} else {
/* Write a 33 bit ULEB128 for the int (lsb=0) or loword (lsb=1). */
if (!LJ_DUALNUM) { /* Narrow number constants to integers. */
if (!LJ_DUALNUM && o->u32.hi != LJ_KEYINDEX) {
/* Narrow number constants to integers. */
lua_Number num = numV(o);
k = lj_num2int(num);
if (num == (lua_Number)k) { /* -0 is never a constant. */
Expand Down
6 changes: 3 additions & 3 deletions src/3rdparty/luajit/src/lj_ccallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ static void *callback_mcode_init(global_State *g, uint32_t *page)
static void *callback_mcode_init(global_State *g, uint32_t *page)
{
uint32_t *p = page;
void *target = (void *)lj_vm_ffi_callback;
ASMFunction target = lj_vm_ffi_callback;
MSize slot;
*p++ = A64I_LE(A64I_LDRLx | A64F_D(RID_X11) | A64F_S19(4));
*p++ = A64I_LE(A64I_LDRLx | A64F_D(RID_X10) | A64F_S19(5));
*p++ = A64I_LE(A64I_BR | A64F_N(RID_X11));
*p++ = A64I_LE(A64I_BR_AUTH | A64F_N(RID_X11));
*p++ = A64I_LE(A64I_NOP);
((void **)p)[0] = target;
((ASMFunction *)p)[0] = target;
((void **)p)[1] = g;
p += 4;
for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {
Expand Down
12 changes: 9 additions & 3 deletions src/3rdparty/luajit/src/lj_emit_arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,22 @@ static void emit_cnb(ASMState *as, A64Ins ai, Reg r, MCode *target)

#define emit_jmp(as, target) emit_branch(as, A64I_B, (target))

static void emit_call(ASMState *as, void *target)
static void emit_call(ASMState *as, ASMFunction target)
{
MCode *p = --as->mcp;
ptrdiff_t delta = (char *)target - (char *)p;
#if LJ_ABI_PAUTH
char *targetp = ptrauth_auth_data((char *)target,
ptrauth_key_function_pointer, 0);
#else
char *targetp = (char *)target;
#endif
ptrdiff_t delta = targetp - (char *)p;
if (A64F_S_OK(delta>>2, 26)) {
*p = A64I_BL | A64F_S26(delta>>2);
} else { /* Target out of range: need indirect call. But don't use R0-R7. */
Reg r = ra_allock(as, i64ptr(target),
RSET_RANGE(RID_X8, RID_MAX_GPR)-RSET_FIXED);
*p = A64I_BLR | A64F_N(r);
*p = A64I_BLR_AUTH | A64F_N(r);
}
}

Expand Down
22 changes: 17 additions & 5 deletions src/3rdparty/luajit/src/lj_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,10 @@ LJ_FUNCA int lj_err_unwind_dwarf(int version, int actions,
if ((actions & _UA_FORCE_UNWIND)) {
return _URC_CONTINUE_UNWIND;
} else if (cf) {
ASMFunction ip;
_Unwind_SetGR(ctx, LJ_TARGET_EHRETREG, errcode);
_Unwind_SetIP(ctx, (uintptr_t)(cframe_unwind_ff(cf) ?
lj_vm_unwind_ff_eh :
lj_vm_unwind_c_eh));
ip = cframe_unwind_ff(cf) ? lj_vm_unwind_ff_eh : lj_vm_unwind_c_eh;
_Unwind_SetIP(ctx, (uintptr_t)lj_ptr_strip(ip));
return _URC_INSTALL_CONTEXT;
}
#if LJ_TARGET_X86ORX64
Expand Down Expand Up @@ -580,9 +580,17 @@ extern void __deregister_frame(const void *);

uint8_t *lj_err_register_mcode(void *base, size_t sz, uint8_t *info)
{
void **handler;
ASMFunction handler = (ASMFunction)err_unwind_jit;
memcpy(info, err_frame_jit_template, sizeof(err_frame_jit_template));
handler = (void *)err_unwind_jit;
#if LJ_ABI_PAUTH
#if LJ_TARGET_ARM64
handler = ptrauth_auth_and_resign(handler,
ptrauth_key_function_pointer, 0,
ptrauth_key_process_independent_code, info + ERR_FRAME_JIT_OFS_HANDLER);
#else
#error "missing pointer authentication support for this architecture"
#endif
#endif
memcpy(info + ERR_FRAME_JIT_OFS_HANDLER, &handler, sizeof(handler));
*(uint32_t *)(info + ERR_FRAME_JIT_OFS_CODE_SIZE) =
(uint32_t)(sz - sizeof(err_frame_jit_template) - (info - (uint8_t *)base));
Expand Down Expand Up @@ -875,6 +883,10 @@ LJ_NORET LJ_NOINLINE static void err_msgv(lua_State *L, ErrMsg em, ...)
const char *msg;
va_list argp;
va_start(argp, em);
if (LJ_HASJIT) {
TValue *base = tvref(G(L)->jit_base);
if (base) L->base = base;
}
if (curr_funcisL(L)) L->top = curr_topL(L);
msg = lj_strfmt_pushvf(L, err2msg(em), argp);
va_end(argp);
Expand Down
3 changes: 3 additions & 0 deletions src/3rdparty/luajit/src/lj_jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ typedef struct GCtrace {
BCIns startins; /* Original bytecode of starting instruction. */
MSize szmcode; /* Size of machine code. */
MCode *mcode; /* Start of machine code. */
#if LJ_ABI_PAUTH
ASMFunction mcauth; /* Start of machine code, with ptr auth applied. */
#endif
MSize mcloop; /* Offset of loop start in machine code. */
uint16_t nchild; /* Number of child traces (root trace only). */
uint16_t spadjust; /* Stack pointer adjustment (offset in bytes). */
Expand Down
14 changes: 14 additions & 0 deletions src/3rdparty/luajit/src/lj_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -1042,4 +1042,18 @@ LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1];
LJ_FUNC int LJ_FASTCALL lj_obj_equal(cTValue *o1, cTValue *o2);
LJ_FUNC const void * LJ_FASTCALL lj_obj_ptr(global_State *g, cTValue *o);

#if LJ_ABI_PAUTH
#if LJ_TARGET_ARM64
#include <ptrauth.h>
#define lj_ptr_sign(ptr, ctx) \
ptrauth_sign_unauthenticated((ptr), ptrauth_key_function_pointer, (ctx))
#define lj_ptr_strip(ptr) ptrauth_strip((ptr), ptrauth_key_function_pointer)
#else
#error "No support for pointer authentication for this architecture"
#endif
#else
#define lj_ptr_sign(ptr, ctx) (ptr)
#define lj_ptr_strip(ptr) (ptr)
#endif

#endif
1 change: 1 addition & 0 deletions src/3rdparty/luajit/src/lj_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,7 @@ static int predict_next(LexState *ls, FuncState *fs, BCPos pc)
cTValue *o;
switch (bc_op(ins)) {
case BC_MOV:
if (bc_d(ins) >= fs->nactvar) return 0;
name = gco2str(gcref(var_get(ls, fs, bc_d(ins)).name));
break;
case BC_UGET:
Expand Down
Loading

0 comments on commit 2875b08

Please sign in to comment.