Commit Graph

297 Commits

Author SHA1 Message Date
Zeev Suraski
3b86ea7dc0 This one slipped away 1999-12-23 18:07:52 +00:00
Zeev Suraski
67b4b3a634 - require() of a dynamic expression now has the standard require() semantics
- Fixed a memory leak in require() of a dynamic expression
1999-12-23 15:03:25 +00:00
Andi Gutmans
ff737b6090 - Remove unused variable. 1999-12-22 14:38:00 +00:00
Zeev Suraski
f0888ccaef Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc()
whenever you're dealing with strings that might be coming back from the engine - there seem
to be a few other places like this in PHP.
1999-12-21 20:30:04 +00:00
Andrei Zmievski
80bab9d939 We're using ZVAL's now. 1999-12-21 17:14:31 +00:00
Zeev Suraski
a2cc070fc2 - Fix @expr 1999-12-20 20:01:19 +00:00
Zeev Suraski
be1bb28355 - Fix the crash Thies was experiencing (returning a function call could cause a crash)
- Fix the leak Thies was experiencing (@fcall() leaked)
1999-12-20 16:05:36 +00:00
Zeev Suraski
223c674c2a - Made things work again (Thies, everybody - please check the latest CVS and see if you're
still getting any problems)
- Changed the interface of call_user_function_ex() to support returning of references
1999-12-19 18:54:40 +00:00
Andi Gutmans
213d0e2fb2 - More fixes related to the return references patch
- eval_string() and call_user_function_ex() still don't work.
- The libzend tree is untested and might not be stabl yet.
1999-12-19 06:39:17 +00:00
Andi Gutmans
7fe808ea02 - By mistake commited this to the branch. It fixes a bug we introduced with
the return reference patch.
1999-12-17 08:24:10 +00:00
Andrei Zmievski
c9c6446aa1 - s/inheritence/inheritance/g
- Added is_subclass_of() function
1999-12-15 21:26:43 +00:00
Zeev Suraski
ced9cee10c - Implement return by reference:
- In function declaration instead of the return statement
  - In the assignment phase
- Implement ability to turn off support for call-time pass by reference
1999-12-15 20:15:32 +00:00
Zeev Suraski
ef596bbafb Move the #include of zend-parser.h out of zend_compile.h 1999-12-06 20:42:44 +00:00
Sascha Schumann
70df2d7478 Fix some warnings 1999-12-05 16:23:45 +00:00
Zeev Suraski
efc84af940 - Implement get_used_files() and get_imported_files() 1999-12-04 14:26:26 +00:00
Zeev Suraski
9baad80459 - Break the zend->PHP dependency introduced by the .php extension for use(),
by providing an API
- Enable Stig's patch for use() extensions (it wasn't refered to by the parser)
- Fix a memory leak in that code
1999-12-04 13:26:57 +00:00
Andi Gutmans
5463dd5b38 - Add use support (behaves like require, but will not use the same file twice)
- Add import support (behaves like include, but requires parentheses;  will not
  use the same file twice; Currently, it is not yet properly implemented, and
  only behaves like include)
1999-11-30 20:15:04 +00:00
Zeev Suraski
6be3723f3d UNIX/non ZTS compile fixes 1999-11-26 23:48:04 +00:00
Zeev Suraski
58153dfed0 - Improve the file handle closing code 1999-11-26 23:45:22 +00:00
Zeev Suraski
6358c6631b - Optimize class instanciation
- Fix constant instanciation for array elements inside objects
1999-11-21 18:11:10 +00:00
Andi Gutmans
52045afb08 - If a function's return value is unused then don't create a ZEND_FREE
opcode but free it after the function call in zend_execute.
1999-11-17 17:21:15 +00:00
Andi Gutmans
b7b614d0b5 - In any case create the free opcode. Need to allow the functions to
create a hint.
1999-11-16 18:46:32 +00:00
Andi Gutmans
dbb67ab9dc - Add support for used_return_value passed to internal functions. 1999-11-16 18:30:06 +00:00
Andi Gutmans
6d988ec694 - Add support for BYREF_FORCE_REST 1999-11-03 19:21:56 +00:00
Andi Gutmans
83c79bb154 - Fix for Thies' leak and Andrei's crash 1999-10-28 15:53:31 +00:00
Andrei Zmievski
62c1407a4d *** empty log message *** 1999-10-15 13:45:28 +00:00
Andi Gutmans
03d354dcf9 - For Andrei. Implement references in array() initializations 1999-10-01 10:00:05 +00:00
Andi Gutmans
06d04d15a8 - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type 1999-09-29 17:18:36 +00:00
Andi Gutmans
228a537bbe - Fix problem where function parameter fetches were created too late. 1999-09-21 20:00:01 +00:00
Andi Gutmans
babad2694e - First step in fixing locking problem. Array fetches are now always done last.
Later on we will want to delay the write fetches even longer until after their
  resulting expression is parsed. The way it is now, will make it very easy
  to delay as long as we need.
1999-09-20 15:44:30 +00:00
Andi Gutmans
82c8a9e745 - Indirect references had all of the fetches by mistakenly backpatched.
Actually all of the fetches are supposed to be read, except for the last
  one.
1999-09-20 14:45:36 +00:00
Zeev Suraski
ca1b3ffbc8 Shut up a warning 1999-09-10 16:16:24 +00:00
Andi Gutmans
22f066e708 - Add foreach() freeing code.
- Fix switch() freeing code to only free current function's switch expressions.
- I have a feeling break expr; in a switch where expr > 1 leaks because it
  won't free all of the expressions. Fix is probably not trivial.
1999-09-09 14:15:17 +00:00
Zeev Suraski
a3f77686ef Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions 1999-09-02 21:06:05 +00:00
Andi Gutmans
1bfb1f7958 - Fix when redefining classes at run-time. 1999-08-26 06:47:45 +00:00
Zeev Suraski
96d4220a5d Fix several class issues 1999-08-14 12:54:17 +00:00
Zeev Suraski
ef5b7e212d Generate better warnings for class/function redefinitions 1999-08-14 11:50:36 +00:00
Andi Gutmans
28f9dc6e56 - Got rid of the C++ comments. 1999-08-10 15:43:32 +00:00
Andi Gutmans
bbe27ffae9 - Initialize extended value's and put the fetch_type in it's own variable
name.
1999-08-03 18:54:49 +00:00
Andi Gutmans
07e0885519 Make set_compiled_filename() return a pointer to the allocated file name 1999-08-02 18:40:10 +00:00
Andi Gutmans
739132e58d - Fixed a leak when doing inheritance. The parent class name wasn't being freed.
- Fixed a stack leak. Functions that had late argument binding were set up as
  INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding
  DO_FCALL_BY_NAME.
1999-07-29 12:24:58 +00:00
Andi Gutmans
741ca16711 - Fixed various inheritance problems & Andrey's leak 1999-07-28 17:59:55 +00:00
Zeev Suraski
879bfc7a34 Inherit parent's constructor 1999-07-27 20:34:31 +00:00
Zeev Suraski
c4bc4871ee Fix runtime inheritence (child functions/members should have higher precedence) 1999-07-27 20:14:58 +00:00
Zeev Suraski
075146773f *** empty log message *** 1999-07-26 21:31:40 +00:00
Zeev Suraski
41308d4b43 Fix a bug in inheritence from classes defined in include files, that are
inherited from require()'d files
1999-07-26 21:18:35 +00:00
Andi Gutmans
8f51f72dc6 - Fix the new operator incompatibility.
- I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped
  win32 from compiling. This needs to be fixed!!!
- Check out libzend to compile the tree now.
1999-07-26 16:57:06 +00:00
Zeev Suraski
0cdb7d6a29 Fix that memory leak... nested function issue remains 1999-07-24 14:38:05 +00:00
Zeev Suraski
9c754da0fc Fix RETURN & SWITCH memory leak issue 1999-07-24 11:43:21 +00:00
Zeev Suraski
1b6fae101a Thoroughly fix the SWITCH problem. No RETURN handling yet. 1999-07-24 11:24:19 +00:00
Zeev Suraski
028cf1a368 Fix bug #1812 1999-07-23 18:41:58 +00:00
Andi Gutmans
bf8c6dbd99 - Get rid of C++ comments 1999-07-20 13:01:30 +00:00
Zeev Suraski
8d1de13aef 0.91 update 1999-07-19 20:02:12 +00:00
Zeev Suraski
d66fad5fcd Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) 1999-07-16 16:42:49 +00:00
Zeev Suraski
b5b1117760 License update 1999-07-16 14:58:16 +00:00
Zeev Suraski
cccd2445ee Get rid of AiCount completely 1999-07-10 11:45:23 +00:00
Zeev Suraski
2a6da7814c Step 4:
Move to a 7-bit counter (not fully implemented yet)
1999-07-09 20:43:59 +00:00
Zeev Suraski
5f62c347c7 Step 2:
Rename is_ref to EA
1999-07-09 17:44:41 +00:00
Zeev Suraski
81d901b14d Step 1 in nuking the garbage collector:
- Change the hash destructor to return int
- Don't kill the bucket on hash_destroy if the destructor returns 0
1999-07-09 17:24:47 +00:00
Zeev Suraski
d894cf44d8 Support definition of classes that are derived from classes that are defined in runtime 1999-07-08 16:55:27 +00:00
Zeev Suraski
c471c77c58 Fix Thies's bug report 1999-06-22 20:24:51 +00:00
Zeev Suraski
3eac45ea80 * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead
of zval *, and it wasn't using reference counting)
* Fix a memory leak in static array()'s with textual indices
1999-06-22 19:05:40 +00:00
Zeev Suraski
d47d83511a E_ERROR -> E_COMPILE_ERROR in the compiler 1999-06-11 13:40:18 +00:00
Zeev Suraski
54d210427a Two fixes:
* The error generated by a failed class inheritence wasn't  properly
  displaying the file in which he error occured.
* Inheritence didn't work if the parent class had uppercase letters in it.
1999-06-11 13:37:29 +00:00
Andi Gutmans
7ed4923441 - Fix the static array() initializing 1999-06-09 19:26:54 +00:00
Andi Gutmans
04b2c1d422 * Fix a by-name call/method call bug
* Clean and optimize the whole function call process
1999-06-08 18:33:31 +00:00
Andi Gutmans
5b0ae2dff3 Work around a compiler bug - mark variables that are sent to functions that aren't yet
defined as FETCH_W (because they might end up being sent by reference)
1999-06-06 17:35:42 +00:00
Zeev Suraski
ed06a70f7f * Centralized shutdown
* Change shutdown order again
1999-06-05 20:00:00 +00:00
Zeev Suraski
89f139d3b0 Call the request_shutdown on modules before destroying symbol tables, so that
the session module can be implemented
1999-06-05 19:10:40 +00:00
Zeev Suraski
8b2fe60467 - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue.
- Fixed numerous AiCount problems
1999-06-05 18:47:36 +00:00
Zeev Suraski
1b4b5c4a88 New $GLOBALS init 1999-06-04 13:09:24 +00:00
Andi Gutmans
52ec64359c Fixes 1999-05-31 18:33:12 +00:00
Zeev Suraski
741b816136 * Support getThis() for internal functions.
* Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't
  work with the optimizer).
* Add new macros for standardized definition of classes.
* Only report AiCount problems if shutdown was not silent.
1999-05-28 12:06:59 +00:00
Zeev Suraski
1250c43a39 * Add struct name to all typedef's so that they can be debugged with MSVC
* Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus
causing AiCount to be decreased multiple times even though it was increased only
once for $var.  Mark all FETCH_DIM's so that they won't decrease AiCount, and only
decrease AiCount on the last FETCH_DIM.
* Fix a stupid bug - forgot to pass CLS_C to some compiler function.  For some reason
MSVC doesn't report these :I
1999-05-22 16:10:51 +00:00
Zeev Suraski
87ba08d1d0 Avoid leaking fd's in case of failures 1999-05-22 02:13:01 +00:00
Andi Gutmans
3facf7cb7c - Updates we did today 1999-05-20 13:04:59 +00:00
Andi Gutmans
d79292d52b - Fix a small problem with class decelerations. 1999-05-20 09:08:29 +00:00
Zeev Suraski
b0bfa458b5 * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed
to char[1], these checks should have been changed to Bucket.nKeyLength==0
* Support runtime declaration of functions.  I ended up changing the grammar
  to catch top level functions vs. nested functions.  The reason is simple -
  if we don't have functions properly declared at compile-time, function calls
  cannot be resolved at compile time, and have to be resolved at runtime, which
  ends up being much much slower (without the optimizer, that is).
  It's no biggy though, the grammar change isn't that bad.
1999-05-15 15:47:24 +00:00
Zeev Suraski
473d1d7cf1 * Fix a bug that occured in case of parse errors. We need to restore the lexical state
even if the compilation failed.
1999-05-11 17:50:37 +00:00
Zeev Suraski
bc3686c14a * Fix a problem with constant quoted strings, that was causing Thies's problem
* Remove a development-time printf
1999-04-30 10:46:48 +00:00
Zeev Suraski
208e81696f Another small fix 1999-04-24 17:16:39 +00:00
Zeev Suraski
5a5806e02a Cleanups, remove old ts code 1999-04-24 00:12:55 +00:00
Zeev Suraski
551fe7780b Make token names uniform, they all begin with T_ now. 1999-04-22 23:08:42 +00:00
Zeev Suraski
a9f9ae7920 Thread safety patch. It works now with 'just in time' resource initialization! 1999-04-21 17:26:37 +00:00
Zeev Suraski
7a87fcbbda Thread safety patch. We're still not quite there but it compiles again, and
more logic has been implemented.
1999-04-21 03:49:09 +00:00
Andi Gutmans
dd03a7a2f3 Support =unset as arguments 1999-04-19 16:28:05 +00:00
Zeev Suraski
342c6e0b23 Whatnot:
* updated alloc_persist to use critical sections
* changed extension shutdown to two-phase
* updated dependencies
* PR support (don't remember if there was any really)
1999-04-18 15:11:52 +00:00
Andi Gutmans
3d631c4ca0 - Should fix the pass by reference problem. This happened because we moved
start from arg 1 now and not arg 0. There might be more places which need fixing
 like in the executor but the bug seems OK now.
1999-04-15 17:41:21 +00:00
Andi Gutmans
39f9487ee1 -Tiny patches 1999-04-14 19:53:33 +00:00
Andi Gutmans
e1e2226b92 - Fix various memory leaks. 1999-04-13 19:28:03 +00:00
Zeev Suraski
15be5f0b4a Destroy the resource list after destroying the symbol table, otherwise the
auto-destructor for resources are run when the resource list is no longer valid
1999-04-12 18:40:18 +00:00
Zeev Suraski
39a7f4c306 This patch is a go. Not fully optimized yet, but working properly.
Prepatch tagged as BEFORE_STACK_PATCH.
1999-04-12 18:29:09 +00:00
Zeev Suraski
b06c5731fc Minor fixes:
missing zval_copy_ctor()
	messed up AiCount fix
1999-04-12 17:59:36 +00:00
Zeev Suraski
0a6e9ddd7f Prevent class redeclarations 1999-04-09 10:59:58 +00:00
Zeev Suraski
17bdb70823 $GLOBALS support 1999-04-08 20:21:36 +00:00
Zeev Suraski
135da4b4fc Fix static assignment 1999-04-08 00:18:29 +00:00
Andi Gutmans
573b46022c Zend Library 1999-04-07 18:10:10 +00:00