Skip to content

Instantly share code, notes, and snippets.

View flavius's full-sized avatar

Flavius Aspra flavius

View GitHub Profile
#!/bin/bash
PHP_V=$1
PHP_SRCD=$(echo $PHP_V | sed s/\\./_/g)
PHP_BIND=$(echo "/usr/local/php$PHP_V/bin")
FLAV_ACTIVATED_PHP=$PHP_V
export FLAV_ACTIVATED_PHP
FLAV_SRCACTIVE_PHP="/home/flav/projects/php/php-src/tags/php_$PHP_SRCD"
export FLAV_SRCACTIVE_PHP
==32647== Source and destination overlap in memcpy(0x6cee1e0, 0x6cee1eb, 8181)
==32647== at 0x4C27B46: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==32647== by 0x7B9EFE: php_stream_fill_read_buffer (streams.c:549)
==32647== by 0x7BA1DB: _php_stream_read (streams.c:605)
==32647== by 0x7BBCD4: _php_stream_copy_to_mem (streams.c:1287)
==32647== by 0x70150B: zif_file_get_contents (file.c:570)
==32647== by 0x5EC62D: phar_file_get_contents (func_interceptors.c:225)
==32647== by 0x872569: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:316)
==32647== by 0x877AA1: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:1606)
==32647== by 0x871569: execute (zend_vm_execute.h:107)
test
#include <stdio.h>
#include <stdlib.h>
#define NUMS 10
typedef struct _foo {
char *t;
int i;
} foo;
@flavius
flavius / Makefile
Created September 6, 2011 11:26
code coverage
CC=gcc
CFLAGS=-Wall -g3 -O0 -fprofile-arcs -ftest-coverage
OBJ_FILES=main.o
primes: $(OBJ_FILES)
$(CC) $(CFLAGS) -o $@ $?
main.o: main.c
$(CC) $(CFLAGS) -o $@ -c $?
a:link {text-decoration:none;}
a:link {color:mediumspringgreen;}
a:link {background-color:maroon;}
In file included from /usr/include/php/Zend/zend.h:237:0,
from /home/flav/phpmeta/meta.c:19:
/usr/include/php/Zend/zend_alloc.h:48:2: error: unknown type name ‘uint’
/usr/include/php/Zend/zend_alloc.h:50:2: error: unknown type name ‘uint’
/usr/include/php/Zend/zend_alloc.h:57:37: error: unknown type name ‘uint’
/usr/include/php/Zend/zend_alloc.h:57:55: error: unknown type name ‘uint’
/usr/include/php/Zend/zend_alloc.h:58:71: error: unknown type name ‘uint’
/usr/include/php/Zend/zend_alloc.h:58:89: error: unknown type name ‘uint’
In file included from /usr/include/php/Zend/zend.h:237:0,
from /home/flav/phpmeta/meta.c:19:
a
#include <zend.h>
#include "php_demo.h"
PHP_METHOD(Bar, __construct) {
long three;
zval *four;
php_printf("%s called\n", __FUNCTION__);
if(FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
&three)) {
1 2