Skip to content

Instantly share code, notes, and snippets.

View tstarling's full-sized avatar

Tim Starling tstarling

  • Wikimedia Foundation
View GitHub Profile
diff --git a/CMake/HPHPFindLibs.cmake b/CMake/HPHPFindLibs.cmake
index d7d5bf2..b54b819 100644
--- a/CMake/HPHPFindLibs.cmake
+++ b/CMake/HPHPFindLibs.cmake
@@ -549,4 +549,5 @@ endif()
target_link_libraries(${target} ${LIBDWARF_LIBRARIES})
target_link_libraries(${target} ${LIBELF_LIBRARIES})
+ target_link_libraries(${target} ${ZEND_COMPAT_LINK_LIBRARIES})
endmacro()
if (*type_spec == '*' || *type_spec == '+') {
int num_varargs = num_args + 1 - post_varargs;
/* eat up the passed in storage even if it won't be filled in with varargs */
varargs = va_arg(*va, zval ****);
n_varargs = va_arg(*va, int *);
type_spec++;
if (num_varargs > 0) {
int iv = 0;
#include <stdlib.h>
#include <stdio.h>
#include <mem.h>
#include <conio.h>
#include <bios.h>
inline int GetField(const long num);
inline void SetField(const long num);
const long MaxNum=500000L;
diff --git a/proxygen/lib/http/codec/HTTP1xCodec.cpp b/proxygen/lib/http/codec/HTTP1xCodec.cpp
index 3fb5205..f38a05e 100644
--- a/proxygen/lib/http/codec/HTTP1xCodec.cpp
+++ b/proxygen/lib/http/codec/HTTP1xCodec.cpp
@@ -499,10 +499,13 @@ HTTP1xCodec::generateBody(IOBufQueue& writeBuf,
return 0;
}
size_t buflen = chain->computeChainDataLength();
- if (buflen == 0) {
- return buflen;
@tstarling
tstarling / make-package-contents.php
Created February 26, 2021 04:44
PECL package <contents> tag generator
<?php
define( 'INDENT', ' ' );
$files = shell_exec(
'git -C ' . escapeshellarg( __DIR__ ) .
' ls-tree --name-only -r HEAD'
);
if ( !$files ) {
<?php
const MASTO_HOST = 'https://wikis.world/';
require __DIR__ .'/../vendor/autoload.php';
function fatalError( $message ) {
print nl2br( htmlspecialchars( $message ) );
exit;
}
@tstarling
tstarling / gist:e33509555d480910cb5d3ea6cb7a1352
Created June 2, 2023 09:29
DOMDocument::getElementsByTagName() disassembly with and without fast ZPP
# With zend_parse_parameters():
$ objdump ext/dom/document.o --disassemble=zim_DOMDocument_getElementsByTagName
ext/dom/document.o: file format elf64-x86-64
Disassembly of section .text:
0000000000001360 <zim_DOMDocument_getElementsByTagName>:
This file has been truncated, but you can view the full file.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /opt/php-master/bin/php-cgi autoload-test.php
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libtinfo.so.6
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/liblber-2.5.so.0
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libicuio.so.70
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libicui18n.so.70
warning: could not find '.gnu_debugaltlink' file for /lib/x86_64-linux-gnu/libicuuc.so.70
[Thread debugging using libthread_db enabled]