Nikita Popov
df1439241a
Simplify code
...
If operator overloading is ignored tmp will be 0 and we can still
use |=. No need to separate this into two cases.
2018-02-19 21:38:10 +01:00
Dmitry Stogov
a02a126d54
Allow optional ignorance of operator overlaoding. Optimizer takes into account possibility of operator overloading at default optimization level, but ignores this possibility at "unsafe" level (opcache.optimization_level=-1).
2018-02-19 12:21:43 +03:00
Nikita Popov
48c0662876
Merge branch 'PHP-7.2'
2018-02-18 17:43:08 +01:00
Nikita Popov
500632ac13
Fix pfsockopen() func info
2018-02-18 17:42:12 +01:00
Nikita Popov
c0abab5fca
Fix ZEND_SL range inference
...
This is a bit tricker than right shifts because shifting in the
sign bit flips the sign. The computed bounds are not tight.
2018-02-18 17:42:12 +01:00
Nikita Popov
202989edf8
Fix ZEND_SR range inference
...
Handle out-of-range RHS correctly.
2018-02-18 17:42:12 +01:00
Nikita Popov
40ff001381
Fix constant() func info
...
Since PHP 5.6 this can also be an array.
2018-02-18 17:42:11 +01:00
Nikita Popov
c404b27135
Fix pg_pconnect() func info
2018-02-18 16:22:17 +01:00
Nikita Popov
1b54a62fcf
Fix gettext func infos
2018-02-18 16:22:16 +01:00
Nikita Popov
a5fa7555dd
More mysqli func info fixes
...
Mainly changing resource returns to objects
2018-02-18 15:34:16 +01:00
Nikita Popov
85597e2932
Merge branch 'PHP-7.2'
2018-02-18 15:34:04 +01:00
Nikita Popov
ae837db8cf
Handle overloaded GMP operators in type inference
2018-02-18 15:33:30 +01:00
Nikita Popov
39974dd65d
Disable negative range inference
...
The negative range inference implementation does not work correctly,
and it's not clear right now how it can be fixed. As such, disable
it entirely for now.
2018-02-18 15:33:28 +01:00
Nikita Popov
b889ff309b
Fix lcfirst() + ucfirst() func info
...
These may return the original string
2018-02-17 23:22:44 +01:00
Nikita Popov
ea1a51f71b
Fix bcpowmod() func_info
...
Returns false on error
2018-02-17 23:22:44 +01:00
Nikita Popov
9c4783cbd3
Fix error_get_last() func info
2018-02-17 23:22:44 +01:00
Nikita Popov
d59c45d112
Fix mysqli_connect() func info
...
This function returns an object, not a resource...
2018-02-17 23:22:44 +01:00
Nikita Popov
50def51d19
Fix bcscale() function info
...
Master only: This function now returns the old scale.
2018-02-17 23:22:43 +01:00
Nikita Popov
2cd40b3aed
Merge branch 'PHP-7.2'
2018-02-17 23:21:31 +01:00
Nikita Popov
846e8a3ec9
Fix COUNT range inference
...
count() on objects may return a negative number :(
2018-02-17 23:18:30 +01:00
Nikita Popov
fa7c23ba27
Fix hash_init() and hash_copy() func info
...
These functions were switched to use objects instead of resources.
2018-02-17 23:18:29 +01:00
Nikita Popov
acb9426a6b
Fix curl_multi_close() func info
...
Returns false on failure
2018-02-17 23:18:29 +01:00
Nikita Popov
8bdf9905da
Fix get_object_vars() func info
...
Numeric keys will be converted to integer nowadays.
2018-02-17 23:18:29 +01:00
Nikita Popov
1a50a50bcf
Add RC flags in init_func_return_info
2018-02-17 23:18:29 +01:00
Nikita Popov
fd5644cd0b
Fix array_values() and array_keys() func info
...
Can return RCN for empty/packed arrays
2018-02-17 23:18:28 +01:00
Nikita Popov
38bee72e40
Fix DCE of throwing NEWs
2018-02-17 14:51:11 +01:00
Nikita Popov
ef10dfc31d
Fix another bug in coalesce elimination
2018-02-17 14:51:11 +01:00
Nikita Popov
257f07ef6d
Fix COALESCE jump optimization
2018-02-17 12:42:21 +01:00
Nikita Popov
b0af9ac733
Avoid live range references in opcodes
...
Don't store the live range of the freed variable for FREE_ON_RETURN
frees, instead look it up at runtime. As this is an extremely
unlikely codepath (in particular, it requires a loop variable with
a throwing destructor), saving the runtime lookup of the live range
is not worth the extra complexity this adds everywhere else.
2018-02-16 21:30:48 +01:00
Nikita Popov
07ad75ca96
Merge branch 'PHP-7.2'
2018-02-16 20:31:01 +01:00
Nikita Popov
0674d677bc
Merge branch 'PHP-7.1' into PHP-7.2
2018-02-16 20:30:49 +01:00
Nikita Popov
372bf8a923
Fixed bug #75969
...
Move NOP stripping out of zend_optimize_block: NOP stripping may
move instructions, which may invalidate a Tsource shared across
an extended basic block.
2018-02-16 20:30:03 +01:00
Nikita Popov
d05ac8f610
Merge branch 'PHP-7.2'
2018-02-09 15:11:42 +01:00
Nikita Popov
7aac61ce76
Fixed bug #75938
...
New modulus range inference implementation has been verified using
https://gist.github.com/nikic/67947ff92cf0e1f7e931f2f0d4cf817f .
The computed bounds are not tight, but it seems to be very hard to
compute tight bounds on modulus operations.
2018-02-09 15:10:23 +01:00
Gabriel Caruso
2d48d734a2
Fix some misspellings
2018-02-06 16:59:00 +01:00
Nikita Popov
39c5857135
Merge branch 'PHP-7.2'
2018-02-05 21:43:50 +01:00
Nikita Popov
1391a0fa0b
Fixed bug #75893
...
It is not sufficient to just add the additional types for aliased
variables at the end of type inference, because types of derived
variables may depend on them. Make sure the additional types are
always added whenever the type of an aliased variable is updated.
2018-02-05 21:41:44 +01:00
Nikita Popov
aa7dbc8ee7
Merge branch 'PHP-7.2'
2018-02-05 21:10:12 +01:00
Nikita Popov
d9e71169e6
Fixed bug #75729
...
Don't try to evaluate substr() and strpos() at compile-time if
mbstring function overloading is enabled. I'm reusing the
COMPILE_NO_BUILTIN_STRLEN for the detection of mbstring function
overloading here, even if it's technically only about strlen()...
2018-02-05 21:08:18 +01:00
Dmitry Stogov
ca035f26aa
Moved "zval.u2.cache_slot" into free room of "zend_op"
2018-02-05 19:41:47 +03:00
Dmitry Stogov
3a794d39f0
Avoid repeatable ARG_SHOULD_BE_SENT_BY_REF() checks in FETCH_*FUNC_ARG and following SEND_VAR_EX. Perform the check once in a new CHECK_FUNC_ARG opcode and reuse in the following FETCH_*FUNC_ARG and SEND_FUNC_ARG (SEND_VAR_EX replacement).
2018-02-05 19:40:06 +03:00
Dmitry Stogov
8c977c3430
typo
2018-02-01 17:46:30 +03:00
Dmitry Stogov
ba298725d1
Changed CATCH instruction format (extended_value moved into op2, op2 into result, result into extended_value)
2018-01-31 22:39:30 +03:00
Dmitry Stogov
9c7fb529ce
Changed FETCH_CONSTANT instruction format (extended_value moved into op1)
2018-01-31 18:15:25 +03:00
Dmitry Stogov
f67f455ef7
Changed FETCH_CLASS instruction format (extended_value moved into op1)
2018-01-31 18:14:43 +03:00
Dmitry Stogov
7141631cc8
Change FETCH/ISSET instruction modifiers:
...
- Get rid of ZEND_ISEMPTY and ZEND_ISSET_ISEMPTY_MASK. Use just single ZEND_ISSET bit to make distinct between isset() and empty()
- Use ZEND_FETCH_GLOBAL, ZEND_FETCH_LOCAL and ZEND_FETCH_GLOBAL_LOCK as bitmask
- Removed unused ZEND_FETCH_STANDARD
- Extended ZEND_FETCH_ARG_MASK
2018-01-30 22:06:05 +03:00
Dmitry Stogov
bf7176c70f
Use reference-counting instead of duplication and separation, if really necessary.
2018-01-19 01:03:24 +03:00
Dmitry Stogov
c5c9a69447
Use ZVAL_DUP() instead of zval_copy_ctor()
2018-01-17 14:59:15 +03:00
Dmitry Stogov
c9034c3b33
Get rid of zend_op_array.early_binding
2018-01-11 19:15:52 +03:00
Nikita Popov
f208187773
Backport narrowing fix to 7.1
...
This is a cherry-pick of 8a4532319d .
2018-01-09 18:41:46 +01:00