<commit_before>#define LPJIT_X64 (defined(_M_X64) || defined(__amd64__))
#define LPJIT_WIN (defined(_WIN32))

||#if (LPJIT_X64 != X64) || (LPJIT_WIN != WIN)
#error "Wrong DynASM flags used: pass `-D X64` and/or `-D WIN`"
#endif

#include "lpjit_dasm.h"
#include "lpjit_compiler.h"
#include "dynasm/dasm_x86.h"

|.if X64
    |.arch x64
|.else
    |.arch x86
|.endif

#include <lua.h>
#include <lauxlib.h>

#include "lpjit.h"
#include "lpjit_lpeg.h"
#include "lpjit_compile.h"
#include "lpjit_memory.h"
#include "lpjit_matcher.h"

// additional labels
//#define LABEL_FAIL Dst->codesize
#define LABELS_NUM 1

#define getoffset(p) (((p) + 1)->offset)

#define CURRENT_I Dst->instruction

#define CURRENT_O lpjit_offsetOf(Dst, CURRENT_I)

typedef void(*InstructionCompiler)(CompilerState*);

typedef struct IC_Reg {
    Opcode opcode;
    InstructionCompiler compiler;
} IC_Reg;

static void lpjit_asmDefines(CompilerState* Dst) {
    // only X64 Linux
    |.define sbegin, rbx
    |.define scurrent, r12
    |.define send, r13
    |.define m_state, r14
    |.define tmp1, rbx
    |.define tmp2, rcx
    |.define tmp3, rdx
    |.define rArg1, rdi
    |.define rArg2, rsi
    //
    |.type mstate, MatchState, m_state
    //
    |.macro prologue
        | push sbegin
        | push scurrent
        | push send
        | push m_state
        | push tmp1
        | push tmp2
        | push tmp3
        | push rax // Integer return values
        | mov m_state, rArg1
        | mov sbegin, mstate->subject_begin
        | mov scurrent, mstate->subject_current<commit_msg>fix error causing the segfault<commit_after>#define LPJIT_X64 (defined(_M_X64) || defined(__amd64__))
#define LPJIT_WIN (defined(_WIN32))

||#if (LPJIT_X64 != X64) || (LPJIT_WIN != WIN)
#error "Wrong DynASM flags used: pass `-D X64` and/or `-D WIN`"
#endif

#include "lpjit_dasm.h"
#include "lpjit_compiler.h"
#include "dynasm/dasm_x86.h"

|.if X64
    |.arch x64
|.else
    |.arch x86
|.endif

#include <lua.h>
#include <lauxlib.h>

#include "lpjit.h"
#include "lpjit_lpeg.h"
#include "lpjit_compile.h"
#include "lpjit_memory.h"
#include "lpjit_matcher.h"

// additional labels
//#define LABEL_FAIL Dst->codesize
#define LABELS_NUM 1

#define getoffset(p) (((p) + 1)->offset)

#define CURRENT_I Dst->instruction

#define CURRENT_O lpjit_offsetOf(Dst, CURRENT_I)

typedef void(*InstructionCompiler)(CompilerState*);

typedef struct IC_Reg {
    Opcode opcode;
    InstructionCompiler compiler;
} IC_Reg;

static void lpjit_asmDefines(CompilerState* Dst) {
    // only X64 Linux
    |.define sbegin, rbx
    |.define scurrent, r12
    |.define send, r13
    |.define m_state, r14
    |.define tmp1, rbx
    |.define tmp2, rcx
    |.define tmp3, rdx
    |.define rArg1, rdi
    |.define rArg2, rsi
    //
    |.type mstate, MatchState, m_state
    //
    |.macro prologue
        | push sbegin
        | push scurrent
        | push send
        | push m_state
        | push tmp1
        | push tmp2
        | push tmp3
        | push rax // Integer return values
        | mov m_state, rArg2
        | mov sbegin, mstate->subject_begin
        | mov scurrent, mstate->subject_current
{'fraction_non_alphanumeric': 0.1238488409018736, 'fraction_numerical': 0.02604001270244522, 'mean_word_length': 3.002541296060991, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1262331', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1217, 'n_words': 301}