Commit Graph

299 Commits

Author SHA1 Message Date
Andi Gutmans
e264a407eb - Change if() to while() to make sure we skip enough opcodes 2001-05-25 09:46:48 +00:00
Andi Gutmans
90c36273b4 - Fix memory leak 2001-05-25 07:26:48 +00:00
Zeev Suraski
bda9c83a82 Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 2001-05-06 19:30:31 +00:00
Zeev Suraski
686eab894c Hear hear, interactive mode is finally showing some progress:
- Support function calls
- Fix crash bug
2001-05-06 15:00:58 +00:00
Zeev Suraski
36ded42156 Make parent:: work in runtime bindings as well 2001-03-07 10:07:25 +00:00
Zeev Suraski
bdacbc4c94 Whitespace fix 2001-03-02 23:56:03 +00:00
Andrei Zmievski
cb00ed2bd3 Don't overwrite existing handlers with parent ones. 2001-02-27 05:18:34 +00:00
Andi Gutmans
d2c9e8074c - Update copyright year 2001-02-26 05:43:27 +00:00
Andrei Zmievski
50f28f4372 Inherit overloaded handlers. 2001-02-03 04:52:29 +00:00
Zeev Suraski
0e08845eb0 Add free_estring() 2001-01-15 10:52:06 +00:00
Andi Gutmans
43adbdcc72 - Fix leak with useless statements such as "foo"; 2000-12-18 13:28:32 +00:00
Stanislav Malyshev
6a356cf5c8 Whitespace fix 2000-12-07 10:36:45 +00:00
Stanislav Malyshev
8ba3eeabd9 Allow var $foo = array(ABC => 1) constructs
# It still doesn't work good with constants, but at least doesn't leak now
2000-12-07 10:36:10 +00:00
Andi Gutmans
8d9082563a - Allow passing references which are returned from functions and new
- statements to be passed by reference.
2000-11-27 18:46:23 +00:00
Andi Gutmans
be6ab20415 - Remove code which has been commented out for ages. 2000-11-22 19:53:17 +00:00
Andi Gutmans
b5d5b3a703 - Baby patch towards making the damn pass-by-ref work. 2000-11-20 20:49:42 +00:00
Andi Gutmans
1ccf94066c - Move SET_UNUSED() to header 2000-11-11 17:59:47 +00:00
Andi Gutmans
5e33cdaef3 - Remove this damn thing once again. 2000-11-10 11:48:12 +00:00
Andi Gutmans
f950a3724c - Maybe it's OK now? :) 2000-11-09 23:54:18 +00:00
Andi Gutmans
113a5bb8c2 - Undo the previous commit for fixing $obj = new foo(). 2000-11-09 23:43:21 +00:00
Andi Gutmans
d9d4824cd3 - Commit experimental patch to fix the problem when doing $a = new foo()
and the constructor assigns $this by reference to other symbol table
  elements. Thanks to Daniel J. Rodriguez on this one.
2000-11-09 22:11:14 +00:00
Zeev Suraski
f1a9920bcf Maintain consistency 2000-11-02 19:27:55 +00:00
Andi Gutmans
ce501c78a8 - Replace do_exit() with zend_do_exit().
- Problem reported by David Hedbor <david@hedbor.org>
2000-11-02 18:42:54 +00:00
Zeev Suraski
d0fbddcc2b Fix a corruption bug, when erroneously allowing to send non-variables by reference (several
bug-db reports seem to originate in this bug)
2000-10-29 19:16:29 +00:00
Zeev Suraski
7b0d92dd18 Unify the names of these last 3 files... 2000-10-29 14:35:34 +00:00
Andi Gutmans
c13cfa040d - Constant expressions which are used multiple times need to be copy_ctored 2000-10-19 09:36:53 +00:00
Stanislav Malyshev
2158bbfa7f Set filename even on recursive include 2000-09-17 08:58:39 +00:00
Andi Gutmans
5348058938 - Forgot to create extended info in include()/require() call 2000-09-11 15:15:57 +00:00
Zeev Suraski
c34f41b7c5 Eliminate run-time leak with eval()'s 2000-08-19 17:50:42 +00:00
Zeev Suraski
7795aca4ca Fix warning issue (compile errors inside require()'d files were incorrectly supressed) 2000-08-15 16:44:40 +00:00
Andi Gutmans
e46ea8864c - This patch should hopefully fix situations where a constructor uses
- the $this pointer as a reference.
2000-08-14 19:17:26 +00:00
Andi Gutmans
e1a3604103 - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED 2000-08-14 04:10:02 +00:00
Stanislav Malyshev
5090b1e8d5 Fix zend_fiel_handle handling. Should fix URL include
and various opened_path inconsistencies.
2000-08-13 18:00:50 +00:00
Andi Gutmans
e5015ed581 @ Fix problem with nested foreach()'s (Andi, Zend Engine) 2000-08-10 22:08:02 +00:00
Andi Gutmans
a1adc81f30 @ Fix switch which only has a default rule (Andi, Zend Engine)
@ Change require_once() to use the same file list as include_once().
@ Patch includes making require() & include() to behave the same when it
@ comes to scoping. require() is now an include() which isn't allowed to fail.
@ require() caused too many memory reallocations which ended up being quite
@ slow for sites that required lots of files. (Andi & Zeev, Zend Engine)
- Fix switch() which only has default rule (bug #5879,
2000-08-10 20:42:57 +00:00
Zeev Suraski
c06692e9ec The patch we promised - redesigned the compilation/execution API:
Advantages:
- Smaller memory footprint for the op arrays
- Slightly faster compilation times (due to saved erealloc() calls and faster zend_op
  initialization)
- include_once() & require_once() share the same file list
- Consistency between include() and require() - this mostly means that return()
  works inside require()'d files just as it does in include() files (it used to
  be meaningless in require()'d files, most of the time (see below))
- Made require() consistent with itself.  Before, if the argument was not a constant
  string, require() took the include() behavior (with return()).
- Removed lots of duplicate code.
Bottom line - require() and include() are very similar now;  require() is simply an include()
which isn't allowed to fail.  Due to the erealloc() calls for large op arrays, require()
didn't end up being any faster than include() in the Zend engine.
2000-08-09 19:22:35 +00:00
Zeev Suraski
a30cde3de5 Fix a possible issue with runtime inheritence under fairly rare circumstance
and optimize a tiny bit
2000-07-26 18:23:30 +00:00
Andi Gutmans
4066a197be - Beautify Zeev's patch a bit. 2000-07-16 22:33:42 +00:00
Zeev Suraski
808f8ed306 Implement parent::foo() 2000-07-16 16:40:21 +00:00
Zeev Suraski
b4266edb07 Add more extended_info calls 2000-07-15 15:41:20 +00:00
Andi Gutmans
80121ead56 - Make is_method_call() static and remove a couple of old lines 2000-07-06 23:28:05 +00:00
Andi Gutmans
af5d38214b - One more fix for the latest patch 2000-07-06 22:29:06 +00:00
Andi Gutmans
2787a746f4 - One dumb bug in my latest patch 2000-07-06 22:21:24 +00:00
Andi Gutmans
5f893e68ff - Complex fix for solving a problem with objects & method calls.
- Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH.
- I need to check this fix on a server so if it doesn't work I will revert
- it.
2000-07-06 22:08:22 +00:00
Andi Gutmans
6d6d52551e - Fix bug #4120 2000-07-03 19:17:57 +00:00
Andi Gutmans
727398b2d4 Add to the API 2000-06-13 19:01:22 +00:00
Zeev Suraski
968d2c5b33 Get rid of <?php_track_vars?> 2000-06-12 16:07:15 +00:00
Andi Gutmans
eb0e694665 - Andrei, this is for you!
- Add zend_register_internal_class_ex() which allows you to specify a
- parent to inherit from. You can either specify the parent directly or via
- its name.
2000-06-09 14:40:14 +00:00
Zeev Suraski
98bf43f229 Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory
basis as well
2000-06-06 19:13:54 +00:00
Zeev Suraski
1c36e3472f Change shutdown order to sort out a crash when assigning a resource id to a static. 2000-06-04 22:09:16 +00:00
Zeev Suraski
0b7a9cea88 - Fix Win32 compilation (Use winsock2.h from now on)
- Add lambda() support
2000-06-03 01:49:49 +00:00
Zeev Suraski
385d1aa664 Fix a crash bug in certain situations of class redeclarations 2000-05-25 16:26:22 +00:00
Zeev Suraski
9a751419cf Refined fix 2000-05-11 18:49:45 +00:00
Zeev Suraski
cb35b7e4ed Fix a memory corruption bug with by-ref function arguments 2000-05-11 18:31:21 +00:00
Thies C. Arntzen
354272315a make waning readable 2000-05-10 09:40:46 +00:00
Andi Gutmans
30da5fd8fc Thoroughly initialize IS_UNUSED for proper cleanup 2000-05-08 21:46:48 +00:00
Andi Gutmans
f2471fd50a - Change the place CAST uses for the op_type 2000-05-03 17:56:44 +00:00
Zeev Suraski
e0a48fe623 Beautify 2000-04-29 01:30:17 +00:00
Zeev Suraski
974671eced *** empty log message *** 2000-04-27 21:48:47 +00:00
Zeev Suraski
4b6594c5e9 Change to using the #define's 2000-04-27 21:26:17 +00:00
Zeev Suraski
e16c38b3f5 - Forgot to keep the ':' in the class_name 2000-04-24 22:13:08 +00:00
Andi Gutmans
4f15966d1b - Fix order of JMPZNZ arguments 2000-04-17 17:16:47 +00:00
Zeev Suraski
4cb9a483d2 - Clean up resource lists namespace
- Prepare extended resource list destructor APIs (currently unused)
2000-04-15 13:02:22 +00:00
Andi Gutmans
cc0d6ac19c - Two more places needed changing 2000-04-10 18:24:38 +00:00
Zeev Suraski
232b90454f Clean up last/size definitions 2000-04-10 18:02:40 +00:00
Andi Gutmans
da3db3d864 - FIx JMPZNZ 2000-04-05 20:55:51 +00:00
Zeev Suraski
523f3cce5f The previous fix ended up being broken, this one should do it 2000-03-31 15:17:43 +00:00
Andi Gutmans
24302e89e5 - Fix bug 2000-03-31 00:05:41 +00:00
Zeev Suraski
b7cd2bfa8e - Make the argument order for the stack applies more consistent with other Zend
data structures
- Fix a possible corruption problem due to switch() C-level optimization
2000-03-29 22:28:04 +00:00
Zeev Suraski
5dba477467 - Some header dependencies cleanup
- Generalize zval_print() and zval_print_r()
2000-03-25 19:10:07 +00:00
Andi Gutmans
6db18997bb - Nuke hash_*_ptr functions 2000-03-24 11:12:30 +00:00
Zeev Suraski
84569c08fc - 2000-03-13 18:01:43 +00:00
Zeev Suraski
fe37f4bca9 - Spare a byte :) 2000-03-13 17:59:30 +00:00
Andi Gutmans
7fc5c94478 *** empty log message *** 2000-03-13 15:49:47 +00:00
Andi Gutmans
b5de395367 - Support require_once(). 2000-03-10 16:04:16 +00:00
Zeev Suraski
5e55e47f7f It's official now... 2000-03-06 05:26:39 +00:00
Andi Gutmans
110b670d44 - Fix typos 2000-03-01 17:10:45 +00:00
Zeev Suraski
0ac9536d99 (c) patch 2000-02-19 22:46:42 +00:00
Andi Gutmans
7fa17e8e08 - Put in the infrastructure for the unset() fix. Right now it has the old
behavior but I just need time tomorrow to add the correct behavior.
2000-02-14 20:31:01 +00:00
Zeev Suraski
0c470af314 Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs 2000-02-07 18:39:14 +00:00
Andi Gutmans
4b0da428e7 - Support the string offset syntax $a{2} with the regular array opcodes.
Will need to write new opcodes sometime but right now it's good enough
  to announce the change to this string offset syntax for beta 4.
2000-02-06 20:18:35 +00:00
Andi Gutmans
7f48989be6 - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list
by mistake contains the same variable twice.
- BTW, there is no defined order of assignment. The value of $a after the
  previous example is undefined, and should not be assumed to be either 1
  nor 2.
2000-02-05 20:19:46 +00:00
Zeev Suraski
9f51f154aa - Stop passing list/plist to internal functions
- Add a typedef for the pCopyConstructor function pointer
- Minor hacks
2000-02-05 15:11:24 +00:00
Zeev Suraski
b6197bcf90 Maintain a state of whether we're compiling and/or executing 2000-02-04 14:45:58 +00:00
Zeev Suraski
b3ec6d5d05 - Fix the annoying problem with list(), that surfaced up after our recent cleaning
patches
2000-02-02 16:47:43 +00:00
Andi Gutmans
131e3a06fb - Get rid of remains of garbage.
- This should fix Thies' UMR
2000-02-01 16:02:38 +00:00
Zeev Suraski
400f464307 Fix ``'s 2000-01-29 17:49:05 +00:00
Andi Gutmans
7663e4f65e - Add parser support for string offsets. This added three shift/reduce
conflicts but they all seem to be fine.
- Cleaned up the parsing rules a bit and made them much more compact and
  elegant.
- Please CVS update and see that I didn't break anything.
2000-01-29 10:16:04 +00:00
Andi Gutmans
336bf35a2c - Make loop a bit faster. 2000-01-28 22:23:28 +00:00
Andi Gutmans
58a0844b1c - Make foreach() now copy the array but use the original array. It can
still be optimized A LOT but it's only a performance issue and not
  a feature issue.
2000-01-24 19:04:07 +00:00
Zeev Suraski
fafbf6d8da - Implement declare() with declarables framework
- Implement ticks - Germany&Norway - 5 points!
2000-01-24 19:00:30 +00:00
Zeev Suraski
62114c1806 Destructors no longer return ints, the low level problem it was intended to solve is long gone now... 2000-01-17 17:33:37 +00:00
Zeev Suraski
dc0e663241 Allow module startup to be separate from the compiler/executor startup 2000-01-16 19:41:15 +00:00
Zeev Suraski
f2d703e916 - Nuke undefined_variable_string
- Introduce IS_UNSET
1999-12-31 13:56:59 +00:00
Andi Gutmans
400ee6caa0 - Fix bug #3073. continue in do..while() loops should work now 1999-12-31 12:56:48 +00:00
Zeev Suraski
b7a5b3c309 - Generalize the fast cache mechanism
- Add the HashTable struct to the fast cache mechanism
1999-12-27 19:07:33 +00:00
Zeev Suraski
aec33aa753 Introduce a zval-specific cache - 5-15% speed improvement 1999-12-26 21:56:59 +00:00
Zeev Suraski
235386b245 Change ALLOC_ZVAL() semantics 1999-12-26 21:21:33 +00:00
Zeev Suraski
e28aff2f7a Optimize 1999-12-24 16:03:44 +00:00
Andi Gutmans
62b2087a84 - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use
them.
1999-12-24 15:22:11 +00:00
Zeev Suraski
946df29029 - Use function_add_ref() here too 1999-12-24 14:49:57 +00:00
Zeev Suraski
b996436b4c Fix a class inheritence leak, when using static varibles in a parent class member function 1999-12-23 19:23:36 +00:00
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