<commit_before>/*
   +----------------------------------------------------------------------+
   | Zend Engine                                                          |
   +----------------------------------------------------------------------+
   | Copyright (c) 1998-2004 Zend Technologies Ltd. (http://www.zend.com) |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.00 of the Zend license,     |
   | that is bundled with this package in the file LICENSE, and is        | 
   | available through the world-wide-web at the following url:           |
   | http://www.zend.com/license/2_00.txt.                                |
   | If you did not receive a copy of the Zend license and are unable to  |
   | obtain it through the world-wide-web, please send a note to          |
   | <EMAIL> so we can mail you a copy immediately.              |
   +----------------------------------------------------------------------+
   | Authors: <NAME> <<EMAIL>>                                |
   |          <NAME> <<EMAIL>>                                |
   +----------------------------------------------------------------------+
*/

/* $Id: zend_compile.h,v 1.311 2005/06/17 15:06:27 dmitry Exp $ */

#ifndef ZEND_COMPILE_H
#define ZEND_COMPILE_H

#include "zend.h"

#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif

#include "zend_llist.h"

#define DEBUG_ZEND 0

#define FREE_PNODE(znode)	zval_dtor(&znode->u.constant);

#define SET_UNUSED(op)  (op).op_type = IS_UNUSED

#define INC_BPC(op_array)	if (CG(interactive)) { ((op_array)->backpatch_count++); }
#define DEC_BPC(op_array)	if (CG(interactive)) { ((op_array)->backpatch_count--); }
#define HANDLE_INTERACTIVE()  if (CG(interactive)) { execute_new_code(TSRMLS_C); }

#define RESET_DOC_COMMENT()        \
    {                              \
        if (CG(doc_comment)) {     \
          efree(CG(doc_comment));  \
          CG(doc_comment) = NULL;  \
        }                          \
        CG(doc_comment_len) = 0;   \
    }
#define MANGLE_MAIN_LEN sizeof("main~") - 1
#define MANGLE_CLASS_NAME(class_name) \
	if (memcmp(class_name->u.constant.value.str.val, "main~", MANGLE_MAIN_LEN) == 0) { \
		class_name->u.constant.value.str.len -= MANGLE_MAIN_LEN; \
		memcpy(class_name->u.constant.value.str.val, class_name->u.constant.value.str.val + MANGLE_MAIN_LEN, class_name->u.constant.value.str.len); \
		class_name->u.constant.value.str.val[class_name->u.constant.value.str.len] = 0; \
	} else if (CG(active_package_entry) && !memchr(class_name->u.constant.value.str.val, '~', class_name->u.constant.value.str.len)) { \
		int len= CG(active_package_entry)->name_length + 1 + class_name->u.constant.value.str.len; \
		char *tmp= estrndup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); \
		class_name->u.constant.value.str.val= (char*) erealloc(class_name->u.constant.value.str.val, len + 1); \
		memcpy(class_name->u.constant.value.str.val, CG(active_package_entry)->name, CG(active_package_entry)->name_length); \
		memcpy(class_name->u.constant.value.str.val+ CG(active_package_entry)->name_length, "~", sizeof("~")); \
		memcpy(class_name->u.constant.value.str.val+ CG(active_package_entry)->name_length+ 1, tmp, class_name->u.constant.value.str.len); \
		class_name->u.constant.value.str.val[len]= 0; \
		class_name->u.constant.value.str.len= len; \
		efree(tmp); \
	}

typedef struct _zend_op_array zend_op_array;
typedef struct _zend_op zend_op;<commit_msg>- use memmove() instead of memcpy(). From `man memcpy`:        In this implementation memcpy() is implemented using bcopy(3), and there-      fore the strings may overlap.  On other systems, copying overlapping      strings may produce surprises.  Programs intended to be portable should      use memmove(3) when src and dst may overlap.<commit_after>/*
   +----------------------------------------------------------------------+
   | Zend Engine                                                          |
   +----------------------------------------------------------------------+
   | Copyright (c) 1998-2004 Zend Technologies Ltd. (http://www.zend.com) |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.00 of the Zend license,     |
   | that is bundled with this package in the file LICENSE, and is        | 
   | available through the world-wide-web at the following url:           |
   | http://www.zend.com/license/2_00.txt.                                |
   | If you did not receive a copy of the Zend license and are unable to  |
   | obtain it through the world-wide-web, please send a note to          |
   | <EMAIL> so we can mail you a copy immediately.              |
   +----------------------------------------------------------------------+
   | Authors: <NAME> <<EMAIL>>                                |
   |          <NAME> <<EMAIL>>                                |
   +----------------------------------------------------------------------+
*/

/* $Id: zend_compile.h,v 1.311 2005/06/17 15:06:27 dmitry Exp $ */

#ifndef ZEND_COMPILE_H
#define ZEND_COMPILE_H

#include "zend.h"

#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif

#include "zend_llist.h"

#define DEBUG_ZEND 0

#define FREE_PNODE(znode)	zval_dtor(&znode->u.constant);

#define SET_UNUSED(op)  (op).op_type = IS_UNUSED

#define INC_BPC(op_array)	if (CG(interactive)) { ((op_array)->backpatch_count++); }
#define DEC_BPC(op_array)	if (CG(interactive)) { ((op_array)->backpatch_count--); }
#define HANDLE_INTERACTIVE()  if (CG(interactive)) { execute_new_code(TSRMLS_C); }

#define RESET_DOC_COMMENT()        \
    {                              \
        if (CG(doc_comment)) {     \
          efree(CG(doc_comment));  \
          CG(doc_comment) = NULL;  \
        }                          \
        CG(doc_comment_len) = 0;   \
    }
#define MANGLE_MAIN_LEN sizeof("main~") - 1
#define MANGLE_CLASS_NAME(class_name) \
	if (memcmp(class_name->u.constant.value.str.val, "main~", MANGLE_MAIN_LEN) == 0) { \
		class_name->u.constant.value.str.len -= MANGLE_MAIN_LEN; \
		memmove(class_name->u.constant.value.str.val, class_name->u.constant.value.str.val + MANGLE_MAIN_LEN, class_name->u.constant.value.str.len); \
		class_name->u.constant.value.str.val[class_name->u.constant.value.str.len] = 0; \
	} else if (CG(active_package_entry) && !memchr(class_name->u.constant.value.str.val, '~', class_name->u.constant.value.str.len)) { \
		int len= CG(active_package_entry)->name_length + 1 + class_name->u.constant.value.str.len; \
		char *tmp= estrndup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); \
		class_name->u.constant.value.str.val= (char*) erealloc(class_name->u.constant.value.str.val, len + 1); \
		memcpy(class_name->u.constant.value.str.val, CG(active_package_entry)->name, CG(active_package_entry)->name_length); \
		memcpy(class_name->u.constant.value.str.val+ CG(active_package_entry)->name_length, "~", sizeof("~")); \
		memcpy(class_name->u.constant.value.str.val+ CG(active_package_entry)->name_length+ 1, tmp, class_name->u.constant.value.str.len); \
		class_name->u.constant.value.str.val[len]= 0; \
		class_name->u.constant.value.str.len= len; \
		efree(tmp); \
	}

typedef struct _zend_op_array zend_op_array;
typedef struct _zend_op zend_op;
{'fraction_non_alphanumeric': 0.22618240954058816, 'fraction_numerical': 0.01138365632199485, 'mean_word_length': 1.9579158316633267, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '812590', 'n_tokens_mistral': 2479, 'n_tokens_neox': 2335, 'n_words': 441}