Implementing assignment of number literal values in 'assignment' opcode handler.
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ecma-alloc.h"
|
||||||
#include "ecma-exceptions.h"
|
#include "ecma-exceptions.h"
|
||||||
#include "ecma-helpers.h"
|
#include "ecma-helpers.h"
|
||||||
#include "ecma-operations.h"
|
#include "ecma-operations.h"
|
||||||
@@ -271,7 +272,25 @@ opfunc_assignment (OPCODE opdata, /**< operation data */
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OPCODE_ARG_TYPE_NUMBER:
|
case OPCODE_ARG_TYPE_NUMBER:
|
||||||
|
{
|
||||||
|
ecma_Number_t *num_p = ecma_AllocNumber();
|
||||||
|
*num_p = get_number_by_idx( src_val_descr);
|
||||||
|
|
||||||
|
right_value.m_ValueType = ECMA_TYPE_NUMBER;
|
||||||
|
ecma_SetPointer( right_value.m_Value, num_p);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case OPCODE_ARG_TYPE_SMALLINT:
|
case OPCODE_ARG_TYPE_SMALLINT:
|
||||||
|
{
|
||||||
|
ecma_Number_t *num_p = ecma_AllocNumber();
|
||||||
|
*num_p = src_val_descr;
|
||||||
|
|
||||||
|
right_value.m_ValueType = ECMA_TYPE_NUMBER;
|
||||||
|
ecma_SetPointer( right_value.m_Value, num_p);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
JERRY_UNIMPLEMENTED();
|
JERRY_UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ main( int __unused argc,
|
|||||||
getop_var_decl( 1),
|
getop_var_decl( 1),
|
||||||
getop_assignment( 0, OPCODE_ARG_TYPE_STRING, 1),
|
getop_assignment( 0, OPCODE_ARG_TYPE_STRING, 1),
|
||||||
getop_assignment( 1, OPCODE_ARG_TYPE_VARIABLE, 0),
|
getop_assignment( 1, OPCODE_ARG_TYPE_VARIABLE, 0),
|
||||||
|
getop_assignment( 0, OPCODE_ARG_TYPE_SMALLINT, 253),
|
||||||
|
getop_assignment( 1, OPCODE_ARG_TYPE_NUMBER, 2),
|
||||||
getop_exitval( 0)
|
getop_exitval( 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user