@@ -2501,9 +2501,19 @@ cb_tree cb_build_cond(cb_tree x) {
25012501
25022502 if (cb_chk_num_cond (p -> x , p -> y )) {
25032503 size1 = cb_field_size (p -> x );
2504- x = cb_build_method_call_3 ("memcmp" , cb_build_cast_address (p -> x ),
2505- cb_build_cast_address (p -> y ),
2506- cb_int (size1 ));
2504+ cb_tree xx ;
2505+ if (CB_LITERAL_P (p -> x )) {
2506+ xx = cb_build_string0 (CB_LITERAL (p -> x )-> data );
2507+ } else {
2508+ xx = cb_build_cast_address (p -> x );
2509+ }
2510+ cb_tree yy ;
2511+ if (CB_LITERAL_P (p -> y )) {
2512+ yy = cb_build_string0 (CB_LITERAL (p -> y )-> data );
2513+ } else {
2514+ yy = cb_build_cast_address (p -> y );
2515+ }
2516+ x = cb_build_method_call_3 ("memcmp" , xx , yy , cb_int (size1 ));
25072517 break ;
25082518 }
25092519 if (CB_TREE_CLASS (p -> x ) == CB_CLASS_NUMERIC &&
@@ -2531,9 +2541,19 @@ cb_tree cb_build_cond(cb_tree x) {
25312541 if (size1 == 1 && size2 == 1 ) {
25322542 x = cb_build_funcall_2 ("$G" , p -> x , p -> y );
25332543 } else if (size1 != 0 && size1 == size2 ) {
2534- x = cb_build_method_call_3 ("memcmp" , cb_build_cast_address (p -> x ),
2535- cb_build_cast_address (p -> y ),
2536- cb_int (size1 ));
2544+ cb_tree xx ;
2545+ if (CB_LITERAL_P (p -> x )) {
2546+ xx = cb_build_string0 (CB_LITERAL (p -> x )-> data );
2547+ } else {
2548+ xx = cb_build_cast_address (p -> x );
2549+ }
2550+ cb_tree yy ;
2551+ if (CB_LITERAL_P (p -> y )) {
2552+ yy = cb_build_string0 (CB_LITERAL (p -> y )-> data );
2553+ } else {
2554+ yy = cb_build_cast_address (p -> y );
2555+ }
2556+ x = cb_build_method_call_3 ("memcmp" , xx , yy , cb_int (size1 ));
25372557 } else {
25382558 if (CB_TREE_CLASS (p -> x ) == CB_CLASS_NUMERIC && p -> y == cb_zero ) {
25392559 x = cb_build_optim_cond (p );
0 commit comments